| <script type="text/javascript"> | |
| jQuery.noConflict(); | |
| jQuery(function(){ | |
| //首先将#back-to-top隐藏 | |
| jQuery("#totop").hide(); | |
| //当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失 | |
| jQuery(function () { | |
| jQuery(window).scroll(function(){ | |
| if (jQuery(window).scrollTop()>100){ | |
| jQuery("#totop").fadeIn(); | |
| } | |
| else | |
| { | |
| jQuery("#totop").fadeOut(); | |
| } | |
| }); | |
| //当点击跳转链接后,回到页面顶部位置 | |
| jQuery("#totop").click(function(){ | |
| jQuery('body,html').animate({scrollTop:0},500); | |
| return false; | |
| }); | |
| }); | |
| }); | |
| </script> |
#share a {
- height:
- position:
- left:
- margin-left:
- cursor:
- bottom:
- text-indent:
- display:
- border:
- transition:
- background:
}
| <div id="share"> | |
| <a id="totop" title="">返回顶部</a> | |
| </div> |