JS 回顶部示例
来源:互联网 发布:淘宝网招聘兼职 编辑:程序博客网 时间:2024/05/03 15:18
CSS部分:
<!--css,js--><style type="text/css">*{margin:0;padding:0;}.box{width:60px;height:50px;position:fixed;bottom:50px;right:5px;display:none;}.box span{width:60px;height:50px;display:block;background:#666;color:#fff;text-align:center;line-height:50px;cursor:pointer;}.box span:hover{background:#ccc;color:#000;}</style>
HTML部分:
<div class="box"><span>TOP</span></div>
JS部分:
<script type="text/javascript"> //监控滚动条事件$(window).scroll(function(){var h =$(window).scrollTop();if(h >= 50){$(".box").fadeIn('slow');}else{$(".box").stop(true,true).fadeOut('slow');}});//点击执行回项部$(".box").click(function(){$("html,body").animate({"scrollTop":0},300);});</script>
0 0
- JS 回顶部示例
- Js回调示例
- js返回页面顶部
- js 返回顶部代码
- js 回到顶部
- js 返回顶部
- js返回顶部代码
- Js返回顶部
- js返回顶部
- JS 回到顶部
- js 回到顶部
- 返回顶部 js
- js返回顶部
- js返回顶部实例
- 源生js回到顶部
- 返回顶部js
- JS 返回顶部功能
- js之回到顶部
- 明天就要考试啦!!!
- Project Euler #1: Multiples of 3 and 5
- 给ListView设计边框
- iOS 打包.a文件
- 这里有虫
- JS 回顶部示例
- 范数
- [转]JavaWeb:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 百世经纶一页书
- iOS各种推送SDK集合
- POJ_3320_Jessica's Reading Problem_尺取法
- 面试中变相考算法复杂度
- hdu4604 Deque,树状数组,最长上升/下降子序列
- typedef用法小结