How to add Flying "Scroll to Top" button to your blog

{ Posted on 6:44 AM by Mack }
Tags : ,
Buzz It

If your Blog has lot of long posts, adding a cool flying 'Scroll to Top' link makes it easier for your visitors to quickly navigate your pages.

So let's get started...


1- Login to your blog and click on the layout button

2- Click on the edit HTML and try to find the following code...

</body>


3- Now add the this code before the code in step 2.


<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

-----------------------*/

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


4- Click on (Ctrl+F) and try to find the the code below:


]]></b:skin>


5- Add the following code before the code in step 4.


#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; }

Now save your changes and your done. enjoy

2 Response to "How to add Flying "Scroll to Top" button to your blog"

join : http://www.a2zhacks.blogspot.com to
1- learn how to earn money online from a blog or website or from a email address for free.
2- learn C C++ VB programming with lots of sample codes.
3- fun jokes send free sms to any mobile shayri etc.
4- to learn windows tips tweaks and hacking.

Thanks a lot for sharing your wonderful views as always.

Seven Steps To Set Up a Blogger Blogspot Blog