日期:2014-05-17 浏览次数:20746 次
<html> <head> <script type=text/javascript src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <link rel="stylesheet" type="text/css" media="all" href="1.css" /> </head> <body> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <div style="display:none;" class="back-to" id="toolBackTop"> <a title="返回顶部" href="#top" class="back-top"> 返回顶部</a> </div> <!--top start--> <script type="text/javascript"> $(document).ready(function () { var bt = $('#toolBackTop'); var sw = $(document.body)[0].clientWidth; var limitsw = (sw - 880) / 2 - 91; if (limitsw > 0){ limitsw = parseInt(limitsw); bt.css("right",limitsw); } $(window).scroll(function() { var st = $(window).scrollTop(); if(st > 30){ bt.show(); }else{ bt.hide(); } }); $("#toolBackTop").click(function () { $('body,html').animate({ scrollTop: '0px'}, 1000); return false; }); }) </script> <!--top end--> </body> </html>
.back-to { bottom: 35px; overflow: hidden; position: fixed; right: 10px; width: 110px; z-index: 999; } .back-to .back-top { background: url("back-top.png") no-repeat scroll 0 0 transparent; display: block; float: right; height: 50px; margin-left: 10px; outline: 0 none; text-indent: -9999em; width: 50px; } .back-to .back-top:hover { background-position: -50px 0 }