jquery实现的鼠标下拉滚动置顶效果
jQuery 实现 效果 鼠标 滚动 置顶
2023-06-13 09:15:39 时间
$(function(){ //置顶按钮显示/隐藏实现 $(window).scroll(function(){ varw_height=$(window).height();//浏览器高度 varscroll_top=$(document).scrollTop();//滚动条到顶部的垂直高度 if(scroll_top>w_height){ $("#goto-top").fadeIn(500); }else{ $("#goto-top").fadeOut(500); } }); //置顶 $("#goto-top").click(function(e){ e.preventDefault(); $(document.documentElement).animate({ scrollTop:0 },200); //支持chrome $(document.body).animate({ scrollTop:0 },200); }); }) </script> <styletype="text/css"> #goto-top{ display:none; position:fixed; width:38px; height:36px; background:url(images/goto-top.png)no-repeat00; bottom:40px; right:40px; -webkit-transition:all0.2s; -moz-transition:all0.2s; -o-transition:all0.2s; transition:all0.2s; z-index:9999; } #goto-top:hover{ background:url(images/goto-top.png)no-repeat0-36px; } </style> </head>
相关文章
- jquery的delegate实现原理[通俗易懂]
- jQuery实现图片上传预览详解编程语言
- jQuery实现发送短信验证码后60秒倒计时详解编程语言
- jquery 实现鼠标划过图片出现放大镜效果详解编程语言
- 几行代码轻松搞定jquery实现flash8类似的连接效果
- jQuery动态酷效果实现总结
- jquery插件实现图片延迟加载效果代码
- 初窥JQuery-Jquery简介入门了解篇
- 用Jquery实现多级下拉框无刷新的联动
- jQuery.each()用法分享
- jquery.blockUI.js上传滚动等待效果实现思路及代码
- 如何使用jquery动态加载js,css文件实现代码
- jQuery实现单行文字间歇向上滚动源代码
- Jquery封装tab自动切换效果的具体实现
- jquery实现带复选框的表格行选中删除时高亮显示
- jquery实现div阴影效果示例代码
- jquery淡入淡出效果的简单实现
- Jquery的Tabs内容轮换效果实现代码,几行搞定
- jquery实现弹出层完美居中效果
- jquery实现点击文字可编辑并修改保存至数据库
- 利用jQuery实现可以编辑的表格
- 两种方法基于jQuery实现IE浏览器兼容placeholder效果
- js与jQuery实现的兼容多浏览器Ajax请求实例
- jQuery实现HTML5placeholder效果实例
- 基于jquery的手风琴图片展示效果实现方法
- jQuery实现数字加减效果汇总
- jquery简单图片切换显示效果实现方法
- jQuery实现的一个tab切换效果内部还嵌有切换