Posted by Prakash timilsina Thursday, December 31, 2009

Share

If your blog have long post then i suggest you to put "Scroll to top" in your blog or website. This enables your visitors to scroll to the top of your blog's page without scrolling the scrolling button on the mouse.
If you want to add this then Follow the instructions,
# Login to your Blogger > Layout > Edit HTML
# Now Find :
</body>
# Now add the below code just after the body tag,

<a href="#" id="backtotop">^ Scroll to Top</a>
  <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
  <script type='text/javascript'>
    /*-----------------------
  Scroll to top
  Creator : Prakash Timilsina,
ComsGuru.blogspot.com

 -----------------------*/
  $(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>

# Now you have to add some CSS for that, Now find
]]></b:skin>
→Paste the below code just above the above code :

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


0 comments

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

Post a Comment

Recent Posts

Goto Top