鼠标下拉滚动置顶效果
2014-07-23 14:27
429 查看
$(function(){ //置顶按钮显示/隐藏实现 $(window).scroll(function(){ var w_height = $(window).height();//浏览器高度 var scroll_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> <style type="text/css"> #goto-top { display:none; position:fixed; width:38px; height:36px; background:url(images/goto-top.png) no-repeat 0 0; bottom:40px; right:40px; -webkit-transition:all 0.2s; -moz-transition:all 0.2s; -o-transition:all 0.2s; transition:all 0.2s; z-index:9999; } #goto-top:hover { background:url(images/goto-top.png) no-repeat 0 -36px; } </style> </head>
11
相关文章推荐
- jquery实现的鼠标下拉滚动置顶效果
- jquery实现的鼠标下拉滚动置顶效果
- 鼠标滚动超过1屏显示置顶图标
- android 自定义scrollview 仿QQ空间效果 下拉伸缩顶部图片,上拉回弹 上拉滚动顶部title 颜色渐变
- 鼠标移上去下拉框出现移走或者点击之后 下拉框消失的效果。
- 给GridView里的行加上鼠标滚动效果
- vue实现ajax滚动下拉加载,同时具有loading效果
- 鼠标滚动事件,侧边导航js效果
- DIV滚动 鼠标悬停效果
- 在Mockplus中,如何做鼠标悬停时菜单下拉的效果?
- js图片根据鼠标左右滚动的效果
- jcarousellite插件鼠标经过和鼠标移出悬浮效果及图片小于可见数是滚动混乱
- JavaScript一点也不简单—实现“鼠标控制局部文字滚动效果”初探
- js之滚动置顶效果
- js图片滚动效果 时间随便定 鼠标移上去停止
- 非常漂亮的图片展示效果,倒影,可以用用鼠标中键滚动,半透明的效果,也很方便改为动态的,带图
- [置顶] 【Android】可以下拉刷新的webview,使你的webview效果更加好看,封装自己的WebView
- js图片滚动效果时间可随意设定当鼠标移上去时停止
- 兼容FF,JS不间断循环滚动,包含自滚动,左右自滚动,点击左右滚动,鼠标暂停效果
- Android实现滚动条下拉反弹效果