Posted by Prakash timilsina Tuesday, January 5, 2010

Share
Last time i gave you the trick to scroll to top! But this trick was not moving so smoothly, So this time i got the great trick to scroll to top!


First of all find :

</body>
Then paste the below code

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
  <script type='text/javascript'>
$(function(){$.fn.scrollToTop=function(){$(this).hide().removeAttr("href");if($(window).scrollTop()!="0"){$(this).fadeIn("slow")}var scrollDiv=$(this);$(window).scroll(function(){if($(window).scrollTop()=="0"){$(scrollDiv).fadeOut("slow")}else{$(scrollDiv).fadeIn("slow")}});$(this).click(function(){$("html, body").animate({scrollTop:0},"slow")})}});
$(function() {
  $("#toTop").scrollToTop();
  });
  </script>
<a href="#" id="toTop">&uarr; Goto Top </a>

Now find :

]]></b:skin>
Then paste the below code just above the above code:

#toTop { width:80px;background:#F4FFBF;border:1px solid #ccc;text-align:center;padding:5px;position:fixed;bottom:10px;right:10px;cursor:pointer;color:#666;text-decoration:none; }

Thats it ;)
if u have any problem the drop the comment

0 comments

    v
:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment

Goto Top