ASP控制Iframe高度自适应
<iframe width="190" id="test" src="gsw.php" frameborder="0" scrolling="no"></iframe></marquee><script type="text/javascript">
var iframeids=["test"]
var iframehide="yes"
function dyniframesize()
{
var dyniframe=new array()
for (i=0; i<iframeids.length; i++)
{
if (document.getelementbyid)
{
dyniframe[dyniframe.length] = document.getelementbyid(iframeids[i]);
if (dyniframe[i] && !window.opera)
{
dyniframe[i].style.display="block"
if (dyniframe[i].contentdocument && dyniframe[i].contentdocument.body.offsetheight)
dyniframe[i].height = dyniframe[i].contentdocument.body.offsetheight;
else if (dyniframe[i].document && dyniframe[i].document.body.scrollheight)
dyniframe[i].height = dyniframe[i].document.body.scrollheight;
}
}
if ((document.all || document.getelementbyid) && iframehide=="no")
{
var tempobj=document.all? document.all[iframeids[i]] : document.getelementbyid(iframeids[i])
tempobj.style.display="block"
}
}
}
if (window.addeventlistener)
window.addeventlistener("load", dyniframesize, false)
else if (window.attachevent)
window.attachevent("onload", dyniframesize)
else
window.onload=dyniframesize
</script>