Iframe height adaptation

From , 3 Years ago, written in JavaScript, viewed 235 times.
URL https://pastebin.vip/view/8bf1211f
  1. function iFrameHeight(id) {  
  2.  
  3.   var iframeid=document.getElementById(id); //iframe id
  4.   if (document.getElementById){
  5.    if (iframeid && !window.opera){
  6.     if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight){
  7.      iframeid.height = iframeid.contentDocument.body.offsetHeight+ 100;
  8.     }else if(iframeid.Document && iframeid.Document.body.scrollHeight){
  9.      iframeid.height = iframeid.Document.body.scrollHeight+ 100;
  10.     }
  11.    }
  12.   }
  13. }
  14.  
  15.  
  16. <iframe src="http://www.baidu.com"  width="100%" height="200" frameborder="0" id="bao_cha_iframe" onLoad="iFrameHeight()"></iframe>

Reply to "Iframe height adaptation"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website