1月28

框架高度自动伸缩代码

| |
13:06 ASP  From: 本站原创
用处:需要局部刷性,AJAX不是很熟练,就用框架吧,框架固定高度,痛苦,下面的代码……

   <script type="text/javascript">
function reinitIframe(){
   var iframe = document.getElementById("tommyhu");
   try{
   var bHeight = iframe.contentWindow.document.body.scrollHeight;
   var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
   var height = Math.max(bHeight, dHeight);
   iframe.height =  height;
   }
   catch (ex){}
}
window.setInterval("reinitIframe()",200);
</script>
<iframe style="width:718px;" frameborder="0" name="cginfo" id="tommyhu" src="tommyhu.asp" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no" onload="this.height=100"></iframe>

框架高度自动伸缩,很简练的代码!
需要修改的地方tommyhu
《蔷薇刑》 陈坤 不错,也听听朋友们!
Windows Media Player文件


最后编辑: tommyhu 编辑于2010/01/29 14:21
阅读(4527) | 评论(0) | 引用(0)
在此留下酱油瓶-:)
表情
emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我

您的大名(例如:小明) : 

密码(可不填) :  游客无需密码

网址 (可不填) : 

电邮 (可不填) :  [注册]