直播一对一源码jquery点击返回页面顶部
1.html<div id='returnTool'>返回顶部</div>2.css (将returnTool层至于页面底部固定不动)<style type="text/css">#returnTool {position:absolute;margin-bottom:0px;width:95%;height:100px;text-align:right;z-i
·
1.html
<div id='returnTool'>返回顶部</div>
2.css (将returnTool层至于页面底部固定不动)
<style type="text/css">
#returnTool {
position:absolute;
margin-bottom:0px;
width:95%;
height:100px;
text-align:right;
z-index:2;
overflow:hidden;
cursor: pointer;
}
</style>
3.js
<script type="text/javascript">
$("#returnTool").click(function () {
$("html,body").animate({scrollTop:"0px"},50);//50毫秒完成回到顶部动画
})
</script>
更多推荐
所有评论(0)