Jaden07 Posted April 8, 2010 Share Posted April 8, 2010 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 More sharing options...
Jaden07 Posted April 12, 2010 Author Share Posted April 12, 2010 Still looking for an answer - haven't found one anywhere else on the internet that I think could help.If anyone has any solutions or ideas, it'd be great to hear them :)Thanks,Jaden Link to comment Share on other sites More sharing options...
Synook Posted April 14, 2010 Share Posted April 14, 2010 Err, have you explored more modern solutions (besides iFrames), such as AJAX? Link to comment Share on other sites More sharing options...
Jaden07 Posted April 18, 2010 Author Share Posted April 18, 2010 Err, have you explored more modern solutions (besides iFrames), such as AJAX?I'm afraid I haven't because I'm unsure where to start - even the name of the language makes it sound complicated haha Link to comment Share on other sites More sharing options...
Synook Posted April 18, 2010 Share Posted April 18, 2010 AJAX isn't a language - it is just a way of using JavaScript's XMLHttpRequest object.http://www.w3schools.com/ajax/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.