html - Iframe height not adjusting with javascript in newer versions of Internet Explorer -


i have iframe links html page. iframe contained within div. found code auto adjust high depending on contents of iframe. code works fine in firefox , older versions of internet explorer not adjusting height in v7 or later.....

javascript:

<script type="text/javascript">      function changecontent(){          document.getelementbyid('right').innerhtml = window.frames['contentframe'].document.getelementsbytagname('html')[0].innerhtml;      }  </script> 

html:

<div class="fl" id="right">     <iframe class="newsframe" id = "contentframe" name = "contentframe" src ="news.html" onload = "changecontent()"></iframe> </div> 

can help.....

try this

function resizepanel() {     window.console.log("ran resize panel function");     var frame = document.getelementsbytagname('iframe')[0];     if(frame != null) {         frame.style.height = frame.contentwindow.document.body.scrollheight + "px";     } } 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -