<iframe src="main.asp" id="ShowSearchInfoinframe" name="ShowSearchInfoinframe" frameborder="0" scrolling="no" class="Inframe" onload="document.all['ShowSearchInfoinframe'].style.height=ShowSearchInfoinframe.document.body.scrollHeight"></iframe>这段代码就可以实现你的需求。注意结帖哦!

解决方案 »

  1.   

    你好。你的这段代码还是只能伸长,不能收缩。<iframe src="main.asp" id="ShowSearchInfoinframe" name="ShowSearchInfoinframe" frameborder="0" scrolling="no" class="Inframe" onload="document.all['ShowSearchInfoinframe'].style.height=ShowSearchInfoinframe.document.body.scrollHeight"></iframe>是这样的,比如ShowSearchInfoinframe是用来调用各个内页。有些1000PX高,有些200PX。当我浏览了1000PX高的页面再到200PX的时候,下边就是空白的,也就是不能自动收缩。麻烦修整一下代码。^_^ 程序...不行~~
      

  2.   

    可能说得有点乱。补充一下 我的网页用iframe调用了几个子页面。只是网络上有无数可以自动扩伸页面的代码,但没有自动收缩的代码。以至浏览过扩伸的页面后,其他页面也都被扩伸而影响效果,不知道哪位高手帮忙写一个,可以真正根据页面的大、小而伸、缩的代码。不甚感激!(相信这个功能是能实现的。)
      

  3.   

    http://blog.csdn.net/meizz/archive/2006/03/27/639857.aspx
      

  4.   

    ^_^ 之前在网上找到过这一段,只是盗版总是盗版,以为被白耍了一次。这次看的是“原版”,功能基本都实现了,还要小调整一下。谢谢。meizz(梅花雪)