Bonjour,
J'ai un petit probléme avec la hauteur d'une iframe.
Je souhaiterais que celle-ci se redimensionne en hauteur selon son contenu.
Pour cela j'ai utilisé un script que j'ai vu sur internet. Sous IE7 il marche sans problème mais pas sous firefox.

Voici le script qui est situé dans le head de la page contenant l'iframe.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
 
<script type="text/javascript"> 
function adjustIFrameSize(iframeWindow) { 
if (iframeWindow.document.height) 
{ 
var iframeElement = document.getElementById(iframeWindow.name); 
iframeElement.style.height = iframeWindow.document.height + 'px'; 
iframeElement.style.width = iframeWindow.document.width + 'px'; 
alert(+iframeWindow.document.height + 'px');
} 
else if (document.all) 
{ 
var iframeElement = document.all[iframeWindow.name]; 
if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') 
{ 
iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px'; 
iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px'; 
alert(+iframeWindow.document.height + 'px');
} 
else { 
iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px'; 
iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px'; 
 
} 
 
} 
} 
</script>
et voici le code que l'on doit insérer dans la page contenu dans l'iframe.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
<body onload="if (parent.adjustIFrameSize) 
parent.adjustIFrameSize(window);" 
>
et voici le code de l'iframe
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
<iframe name="hello" id="hello" marginwidth="0" marginheight="0" src="../articles.php?lien=6&amp;forum=2.php" scrolling="auto" class="complet7" frameborder="1"></iframe>
Merci d'avance pour votre aide