javascript - Iframe working but Height always increase -


hello after hours of search found script works iframe exept little problem never stops increases height no stop... here code add script @ page want iframe

<script>   function alertsize(pixels){     pixels+=0;     document.getelementbyid('myiframe').style.height=pixels+"px";   } </script> <script type="text/javascript">   var myheight = 0;    setinterval(function(){     if(myheight != document.body.scrollheight){       myheight = document.body.scrollheight;       parent.alertsize(myheight);     }   },500); </script> 

here iframe:

<iframe id="myiframe" src="http://www.altasoft.gr/hermes/index.html"         name="myiframe" width="100%" height="100%" scrolling="no"         frameborder="0"></iframe> 

the problem height="100%" in markup. change fixed pixel value, , script start working. change height="100%" height="1" or whatever, exact value doesn't matter.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -