日期:2014-05-16 浏览次数:20425 次
//taolm 用来处理iframe自适应高度的js方法 //down 参数为iframe的id function dyniframesize(down) { var pTar = null; if (document.getElementById){ pTar = document.getElementById(down); } else{ eval('pTar = ' + down + ';'); } if (pTar && !window.opera){ //begin resizing iframe pTar.style.display="block" if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){ //ns6 syntax pTar.height = pTar.contentDocument.body.offsetHeight +20; pTar.width = pTar.contentDocument.body.scrollWidth+20; } else if (pTar.Document && pTar.Document.body.scrollHeight){ //ie5+ syntax pTar.height = pTar.Document.body.scrollHeight; pTar.width = pTar.Document.body.scrollWidth; } } }
<iframe src="" name="glxxmain" id="glxxmain" scrolling="No" noresize="noresize" onload="javascript:dyniframesize('glxxmain');" frameborder=0 width=100% />