欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

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

更新时间: 2014-01-05 01:52:25 责任编辑: Author_N1

 

滚动条在最下面
类似聊天功能

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

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

谢谢!



--参考方法--
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>
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 01:52:25
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/2331/
本文WWW.DOC100.NET DOC100.NET版权所有。