jquery实现返回顶部效果

2015-09-01 0 874
jquery实现返回顶部效果

jQuery("#gotop").css(’display’,’none’);jQuery(window).scroll(function(){if(jQuery(this).scrollTop()>100){jQuery("#gotop").fadeIn(1000)}else{jQuery("#gotop").fadeOut(750)}});jQuery("#gotop").click(function(){jQuery("html, body").animate({scrollTop:0},300);return false})

滑动到一定距离,返回顶部按钮出现,点击后使用动画animate返回到顶部

遇见资源网 js/jquery jquery实现返回顶部效果 http://www.ox520.com/11260.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务