`

ifrma 自动高度

 
阅读更多

<script type=text/javascript>
<!--
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
//extra height in px to add to iframe in FireFox 1.0+ browsers
var FFextraHeight=getFFVersion>=0.1? 16 : 0

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+FFextraHeight;
}
else if (pTar.Document && pTar.Document.body.scrollHeight){
//ie5+ syntax
pTar.height = pTar.Document.body.scrollHeight;
}
}

}
-->
</script>
......
......
<iframe name="down" frameborder="0" scrolling="no" id="down" onload="javascript:dyniframesize('down');" allowTransparency="true" src="content.asp" width="100%" ></iframe>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics