龙之家园  
我的博客我做主!

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>

posted on 2008-01-17 20:23  zhengfeng  阅读(1206)  评论(0编辑  收藏  举报