par
noone67 » 01 mai 2010, 09:24
Bonjour,
j'ai un petit problème pour redimensionné mon iframe, en fait je voudrais que la scroll barre de l'iframe ne soit pas la si mon contenu dépasse l'iframe donc que ca soit dynamique donc j'ai fait une fonction js qui permet de faire ça mais cependant cela ne marche pas sous firefox = ( sous ie pas de problème...
Je dois recup la taille du contenu de l'iframe puis mettre à jour l'iframe sous ie pas de problème j'arrive a recup la taille du contenue mais sous firefox impossible aucune fonction marche pour recup cette taille !!
Voici mon code js :
Code : Tout sélectionner
maframe = parent.document.getElementById('contenu_ajax');// frame in the parent
function resizeIframe()
{
//var the_height=maframe.contentWindow.document.body.scrollHeight;
//var the_height= maframe.contentDocument.documentElement.scrollHeight;
//var the_height = maframe.contentDocument.body.scrollHeight;
//var the_height=maframe.contentWindow.document.body.scrollHeight;
//var the_height = maframe.contentDocument.scrollHeight;
alert(document.body.clientHeight);
var the_height=document.body.clientHeight
alert(the_height);
//the_height -= maframe.offsetTop;
the_height=the_height+100;
alert(the_height);
maframe.style.height = the_height+"px";
}
maframe.onload = resizeIframe;
window.onresize = resizeIframe;
Merci d'avance : )
Bonjour,
j'ai un petit problème pour redimensionné mon iframe, en fait je voudrais que la scroll barre de l'iframe ne soit pas la si mon contenu dépasse l'iframe donc que ca soit dynamique donc j'ai fait une fonction js qui permet de faire ça mais cependant cela ne marche pas sous firefox = ( sous ie pas de problème...
Je dois recup la taille du contenu de l'iframe puis mettre à jour l'iframe sous ie pas de problème j'arrive a recup la taille du contenue mais sous firefox impossible aucune fonction marche pour recup cette taille !!
Voici mon code js :
[code]
maframe = parent.document.getElementById('contenu_ajax');// frame in the parent
function resizeIframe()
{
//var the_height=maframe.contentWindow.document.body.scrollHeight;
//var the_height= maframe.contentDocument.documentElement.scrollHeight;
//var the_height = maframe.contentDocument.body.scrollHeight;
//var the_height=maframe.contentWindow.document.body.scrollHeight;
//var the_height = maframe.contentDocument.scrollHeight;
alert(document.body.clientHeight);
var the_height=document.body.clientHeight
alert(the_height);
//the_height -= maframe.offsetTop;
the_height=the_height+100;
alert(the_height);
maframe.style.height = the_height+"px";
}
maframe.onload = resizeIframe;
window.onresize = resizeIframe;
[/code]
Merci d'avance : )