当前位置: 代码迷 >> vbScript >> 滚动条在最下面,该如何处理
  详细解决方案

滚动条在最下面,该如何处理

热度:6789   发布时间:2013-02-26 00:00:00.0
滚动条在最下面
类似聊天功能

我想页面打开时如果这个层有滚动条的话是在最下面的

我留言的增多也是总处在最下面

谢谢!



------解决方案--------------------------------------------------------
HTML code
<html>    <head>        <title> new document </title><script language="javascript"><!--function func(){    div1.innerHTML += new Date() +'<br>';     document.getElementById('div1').scrollTop = document.getElementById('div1').scrollHeight;    //注意这句    setTimeout('func()', 500);}//--></script>    </head>    <body onload="func()">        <div id="div1" style="width:500px; height:500px; overflow:scroll;"></div>    </body></html>
------解决方案--------------------------------------------------------
不想设时间去掉就行了哇。
------解决方案--------------------------------------------------------
在要打开的网页的最下方写个锚点,
链接这个网页的时候,url后面加#你的锚点
例如:
a.htm:
<body>
<a href="b.htm#zhushaoyue">转向b页面</a>
</body>

b.htm
<body>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<p>....wewewewe...</p><br>
<a name=zhushaoyue><p>....wewewewe...</p><br></a>
  相关解决方案