js,html-点击直接跳转到页面底/顶部

案例一:js控制,无滑动效果

<html>
<body>
<a href="javascript:void(0);" onclick="javascript:document.getElementsByTagName('BODY')[0].scrollTop=document.getElementsByTagName('BODY')[0].scrollHeight;"搜索>到页底</a>
<div style="height:3000px;"></div>
<a href="javascript:void(0);" onclick="javascript:document.getElementsByTagName('BODY')[0].scrollTop=0;">回页顶</a>
</body>
</html>

 

案例二:html描点控制。无滑动效果

<body>
<a href="#DD" >bottom</a>//跳到id为DD的锚点
// 内容
<a id='DD' ></a>//空的锚点
</body>

 

posted @ 2017-03-10 14:08  243573295  阅读(9335)  评论(0编辑  收藏  举报