jQuery实现返回顶部效果
2016-01-11 17:57
751 查看
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> .toTop{ width: 38px; height: 38px; background: yellow; text-decoration: none; overflow: hidden; position: fixed; right: 100px; bottom: 100px; } </style> <script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> $(function(){ $(".toTop").click(function(){ $("body").scrollTop(0); }) }) </script> </head> <body> <a href="#none" class="toTop"><span>返回<br/>顶部</span></a> </body> </html>
相关文章推荐
- jQuery 获取屏幕高度、宽度
- jquery 工作空间注册
- jQuery全屏滚动插件FullPage.js中文帮助文档API
- jQuery对象和DOM对象使用说明
- jquery插件EasyUI中form表单提交实例分享
- jQuery Validate 表单验证插件----在class属性中添加校验规则进行简单的校验
- jQuery Mobile 页面事件总结
- jQuery源码分析
- jQuery性能相关
- jquery的硬伤(若干局限性)
- Check (Validate) File (Image) Size before upload using JavaScript and jQuery
- [jQuery] DOM & CSS
- jquery中click被执行两次的解决办法
- jQuery 源码分析 选择器
- 精心挑选10款优秀的 jQuery 图片左右滚动插件
- 4000 jquery attr和prop
- jquery 解析带命名空间的xml文件
- jqueryeasyui三级联动
- jQuery及HTML5 插件的使用计划列单
- jQuery学习笔记