Jump to content

Internet Explorer Variable iFrame Height


Jaden07
 Share

Recommended Posts

Hi,I'm having problems with varying my iframe height in Internet Explorer. If you view my website (www.cityvoices.co.uk) in either Google Chrome or the latest Mozilla FireFox brower, they display the content perfectly fine. However, if you view the website through Internet Explorer, you'll see that the iframe doesn't expand to the height of the content. My current iframe code is:<script type="text/javascript"> //<![CDATA[window.onload = function() {var f = document.getElementById("mainframe");//Sets iframe idfunction resize() { //Starts resize functionvar h = "6000";var w = "";if (f.contentDocument) {h = f.contentDocument.documentElement.offsetHeight + 5 + "px";// can't find anything for Opera and Firefox that works for the width. OffetWidth doesn't work right either.(f.contentDocument.documentElement,"").getPropertyValue("width");} else if (f.contentWindow) {h = f.contentWindow.document.body.scrollHeight + 0 + "px";} else {return;}f.setAttribute("height",h);f.parentNode.setAttribute("height",h);}if (window.addEventListener) {f.onload = resize;} else if (f.attachEvent) {f.attachEvent("onload", resize);} else {return;}resize(); //starts resize function that was coded further up the code}//]]></script><iframe name="mainframe" id="mainframe" src="i_home.html" width="100%" frameborder="0" allowtransparency="yes" scrolling="No"></iframe>And this all goes into the <body> tags.I'm a novice when it comes to coding so if you have an answer, please explain as easily as possible haha :)Thanks,Jaden

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...