zoukankan      html  css  js  c++  java
  • 自定义博客园---返回顶部

    在页首HTML代码中添加

    <style>
    #back-top {
         position: fixed;
         bottom: 10px;
         right: 5px;
         z-index: 99;
    }
    #back-top span {
          50px;
         height: 64px;
         display: block;
         background:url(http://images.cnblogs.com/cnblogs_com/seanshao/855033/o_rocket.png) no-repeat center center;
    }
    #back-top a{outline:none}
    </style>
    <script type="text/javascript">
    $(function() {
    	// hide #back-top first
    	$("#back-top").hide();
    	// fade in #back-top
    	$(window).scroll(function() {
    		if ($(this).scrollTop() > 500) {
    			$('#back-top').fadeIn();
    		} else {
    			$('#back-top').fadeOut();
    		}
    	});
    	// scroll body to 0px on click
    	$('#back-top a').click(function() {
    		$('body,html').animate({
    			scrollTop: 0
    		}, 500);
    		return false;
    	});
    });
    </script>
    <p id="back-top" style="display:none"><a href="#top"><span></span></a></p>
    

    转载至 风行天下·

  • 相关阅读:
    48音标
    business expressions(二)
    Pick up lines搭讪
    Greetings
    business expressions(一)
    analyzing problems
    business meeting
    idea缓存目录mac cache
    Sublime 3156 LICENSE key
    React从0到1
  • 原文地址:https://www.cnblogs.com/Fflyqaq/p/12867614.html
Copyright © 2011-2022 走看看