<script>
$(document).ready(function(){
$(window).scroll(function(){ var scrolltop=$(this).scrollTop(); if(scrolltop>=150) { $("#totop").show(); }else { $("#totop").hide(); } }); $("#totop a").hover(function(){ $(this).addClass("cur"); },function(){ $(this).removeClass("cur"); }); $("#totop").click(function (){ CompleteScroll(0); }); }); function CompleteScroll(flag){ if(flag==0){ $("html,body").animate({scrollTop: 0}, "slow"); }else{ var s = $("body").height()-$(window).height(); $("html,body").animate({scrollTop: s+60}, "slow"); } }</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>tt</title> <style type="text/css"> <!-- #totop{position:fixed;bottom:40px;right:10px;z-index:999;width:71px; cursor:pointer; display:none;} *html #totop{position:absolute;cursor:pointer;right:10px; display:none;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight)-112+"px")} #totop a{display:block;width:71px;height:24px;padding-top:48px;background:url(../images/toTop.gif) no-repeat;text-align:center;color:#888} #totop a.cur{background-position:-88px 0;text-decoration:none;color:#3a9} //--> </style> <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script> </head> <body> <p>1</p> <p>1</p> <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p> <div id="totop"><a>返回</a></div> <script src="js/public.js" type="text/javascript"></script> </body> </html>