页面置顶置底按钮的简单添加

在页面的顶部加入代码:

<a name="startPotion" ></a>

然后置顶按钮:

<input type="button" value="置顶" onclick="toTop()">

js函数:function toTop(){

    Window.location.href = "#startPotion"

}

 

置底的方法同置顶

posted @ 2012-06-09 22:22  积累从点滴开始  阅读(4153)  评论(0编辑  收藏  举报