Hi, I have a iframe loading inside a wordpress header and footer. The problem is when navigating in the page inside the iframe the height of content varies. I want the iframe resized dynamically as the content's height changes. I want someone to provide the code I must add for this to the pages. The iframe src is on another domain but I have access to that domain. Contact right away as I want a solution asap. hereis the page with the iframe: http://bit.ly/sjD3jT Thanks,
please add this code <iframe src="xyz.com" width="your desired" height="inherit" > or height="auto" height="inherit"
hey that doesn't work. I set it to auto and inherit both dint work. You can check by going to the url i psoted above.
ok try this <script language="JavaScript"> <!-- function autoResize(id){ var newheight; var newwidth; if(document.getElementById){ newheight=document.getElementById(id).contentWindow.document .body.scrollHeight; newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth; } document.getElementById(id).height= (newheight) + "px"; document.getElementById(id).width= (newwidth) + "px"; } //--> </script> <iframe src="http://extremeseotools.com/signup/cart.php?systemtemplate=rentseo" width="100%" height="200px" id="iframe1" marginheight="0" scrolling='no' frameborder="0" onLoad="autoResize('iframe1');"></iframe>
I can do this with jQuery if you would like. I am sending you my contact details right away so you can contact me if you would like me to do this with jQuery. Thanks, bud!