您的位置:首页 > 其它

iframe传值和自适应高度

2008-01-17 20:23 148 查看
iframe传值

用于跳转页面的同时,向多个框架传值

<body onload="document.paimai.location.href='paimai_frame_all.asp?id=<%=request("id")%>'" >
paimai为框架标识

iframe自适应高度

<script>

function SetWinHeight(obj)

{

var win=obj;

if (document.getElementById)

{

if (win && !window.opera)

{

if (win.contentDocument && win.contentDocument.body.offsetHeight)

win.height = win.contentDocument.body.offsetHeight;

else if(win.Document && win.Document.body.scrollHeight)

win.height = win.Document.body.scrollHeight;

}

}

}

</script>

用法:win 为iframe标识

<iframe width="778" align="center" height="200" id="win" name="win" onload="Javascript:SetWinHeight(this)" frameborder="0" scrolling="no"></iframe>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: