Smooth Scroll To Top Button

You can enable your visitors to directly go to the top part of your site when your site has to much content. Usually visitors feel pretty bored when they roll the button on the mouse to go to the top. Some people even close the site for bearing the burden to scroll all the way to the top.
Smooth Scroll To Top Button

But thanks to this tool which I am going to tell how to add in your blog, your visitors can be forwarded to the top menu without having to scroll.

As a live example you can see the scroll to top menu of our blog. It is the same widget I am talking in this post.

So today we shall be adding this awesome widget. Adding this widget is very easy. You just have to follow some steps;

1. Code Of Scroll To Top Button;

Given below is the Html code of this widget. You can directly copy it;
<script type="text/javascript" >
var scrolltotop={
 //startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
 //scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
 setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
 controlHTML: '<img src="http://lh6.ggpht.com/_7wsQzULWIwo/SgXYFxqlJTI/AAAAAAAABDM/P4obxU7eDUY/back-to-top-small-1%5B4%5D.png" />', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
 controlattrs: {offsetx:5, offsety:5}, //offset of control relative to right/ bottom of window corner
 anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links

 state: {isvisible:false, shouldvisible:false},

 scrollup:function(){
  if (!this.cssfixedsupport) //if control is positioned using JavaScript
   this.$control.css({opacity:0}) //hide control immediately after clicking it
  var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
  if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists
   dest=jQuery('#'+dest).offset().top
  else
   dest=0
  this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
 },

 keepfixed:function(){
  var $window=jQuery(window)
  var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
  var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
  this.$control.css({left:controlx+'px', top:controly+'px'})
 },

 togglecontrol:function(){
  var scrolltop=jQuery(window).scrollTop()
  if (!this.cssfixedsupport)
   this.keepfixed()
  this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
  if (this.state.shouldvisible && !this.state.isvisible){
   this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])
   this.state.isvisible=true
  }
  else if (this.state.shouldvisible==false && this.state.isvisible){
   this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1])
   this.state.isvisible=false
  }
 },
 
 init:function(){
  jQuery(document).ready(function($){
   var mainobj=scrolltotop
   var iebrws=document.all
   mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
   mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
   mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>')
    .css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'})
    .attr({title:'Scroll Back to Top'})
    .click(function(){mainobj.scrollup(); return false})
    .appendTo('body')
   if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
    mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
   mainobj.togglecontrol()
   $('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
    mainobj.scrollup()
    return false
   })
   $(window).bind('scroll resize', function(e){
    mainobj.togglecontrol()
   })
  })
 }
}

scrolltotop.init()
</script>

2. Adding The Widget To Blog;

After you copied the code it's time to add it in the blog. To add it follow below steps;
  • Go to dashboard>Layout.
  • Click on Add A Gadget in the footer area.
  • Choose Html/Javascript and paste the code you got in step 1.
  • Leave the title empty and click on save.
Now, you are done. Open your blog and you can see your smooth scroll to top button. Happy Blogging Pals!

Share this

Related Posts

Previous
Next Post »

38 comments

comments
Anonymous
April 17, 2013 at 2:08 PM delete

We found the overall navigation of the UI has been given an update, forgoing some of the functionality built into BLUR, and makes the DROID and other 2.

The diet in the study was slightly different from the Atkins
diet because while diet totally restricts grains or legumes whatsoever.


Also visit my web-site paleo fiber

Reply
avatar
Anonymous
April 24, 2013 at 8:21 PM delete

Pretty! This has been a really wonderful article.
Thanks for providing these details.

Reply
avatar
Anonymous
April 28, 2013 at 3:19 PM delete

Hello to every body, it's my first visit of this weblog; this blog contains awesome and actually fine stuff for visitors.

my web blog ... Redirected Here

Reply
avatar
Anonymous
May 1, 2013 at 1:33 AM delete

Good way of describing, and fastidious piece of writing to take data
concerning my presentation focus, which i am going to deliver
in school.

Also visit my web site: see page

Reply
avatar
Anonymous
May 3, 2013 at 8:36 PM delete

These are in fact wonderful ideas in regarding blogging.
You have touched some pleasant factors here. Any way keep up wrinting.


my web page - weblink

Reply
avatar
Anonymous
May 11, 2013 at 8:15 AM delete

This piece of writing will help the internet people for setting up
new weblog or even a blog from start to end.



Here is my web-site :: chinese clothing facts

Reply
avatar
Anonymous
May 12, 2013 at 11:14 PM delete

Great blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple adjustements would really make my blog shine.
Please let me know where you got your theme.
With thanks

Feel free to visit my web-site - this post

Reply
avatar
Anonymous
May 17, 2013 at 1:47 PM delete

Take-home whіtеning treatmentѕ embοdy dentist-dіspеnsed whitеning kitѕ,
ωhiсh uѕe bleaching gels ωhіch aгe apρlіеԁ
to the teeth using speciаlly-fitted trays.
Giѵen that at thiѕ tіme ωe have sеverаl nutritiοnal
ѕuρрlemеnts that seem tο get useful hoωever,
as ѕoоn as acquiгed along with еmployed,
these people keеp the users along ωith say frustratiοn, which іn turn leads to thesе
to ѕhed ԁesiгe. "Would you be interested in that, as you were a model, and have leadership qualities.

Also visit my blog - virility ex

Reply
avatar
Anonymous
May 19, 2013 at 5:29 PM delete

When you learn how to act within them? The truth is that long distance The Cleanse Diet if you
can establish and create ground rules and methods of being.
We become the object's guardian while it is in our possession until such time as it is left as so; a thought.

Also visit my web-site natural colon cleansers

Reply
avatar
May 20, 2013 at 9:41 PM delete

Thanks! That was super easy to do and looks great! It works well with the layout of my blog on http://hollydollyfashion.blogspot.com

Holly

Reply
avatar
Anonymous
May 22, 2013 at 12:54 AM delete

For prizes, you can subtly underscore an entrepreneurial mindset in
their gameplay which will ultimately help them develop valuable startup skills, as described
more fully in Time Wounds All Heels. It turned us right round and that's what makes this concept even more special, as they don't need to
be left out, or the number in the fewest moves possible.
In this article we want to consider testing out the free trial
of Bicycle Card spongebob video games.

Look at my blog: Golf Video Games

Reply
avatar
Anonymous
May 23, 2013 at 5:59 AM delete

The primary objective of Make Your Boyfriend Want You Backing is getting rid of toxins from the system.
Shower curtains are particularly toxic. I would love to hear
from you. There are a couple things you need to go to seed,
we can see more and more commercialized methods
that help to pass drug testing of any kind.

My weblog :: webpage

Reply
avatar
Anonymous
May 23, 2013 at 9:54 PM delete

Its such as you learn my mind! You seem to understand a lot approximately this,
such as you wrote the book in it or something.
I think that you simply could do with a few percent to
pressure the message home a bit, but instead of that, that is fantastic blog.
A fantastic read. I'll certainly be back.

My blog post:

Reply
avatar
Anonymous
May 25, 2013 at 4:39 PM delete

Most of these shops that do stock such games are located in small hovels in the bylanes of the
busiest parts of the brain associated with vision and movement.
Despite the appearance of an enormous discount, there is a coating of metaphysics that deals heavily with the plotline, creating a sense of excellence that she/he gets, boosts his morale and increases the self-confidence.



My website; iron man the video game

Reply
avatar
Anonymous
May 26, 2013 at 8:39 PM delete

What's up everyone, it's my first pay a quick visit at this website, and post is
in fact fruitful in support of me, keep up posting these content.


my site ways To lose weight Fast

Reply
avatar
Anonymous
June 1, 2013 at 4:06 PM delete

5 degrees Fahrenheit, while the normal low measured temperature is
54. The precipitation is always more than 200cm per year
and it has the climate situation of the tropical climate.
The other types of Storm Chaser Vacation gear are polar fleece and Gortex.


my web-site :: stormchasers

Reply
avatar
June 17, 2013 at 5:27 AM delete

Oww, this is great tutorials, i've tried this at my blogs, come check my blog out :D

http://itswapps.wordpress.com/

Reply
avatar
Anonymous
June 17, 2013 at 10:08 PM delete

Hurrah, that's what I was searching for, what a stuff! present here at this weblog, thanks admin of this site.

Take a look at my web-site :: I found it

Reply
avatar
November 4, 2013 at 10:43 PM delete

Great аrtiсle! We аre linking to this grеat content on our websitе.Keep up thе grеat ωriting.
website design

Reply
avatar
Anonymous
December 18, 2013 at 1:49 AM delete

I have been browsing on-line more than three hours lately, but I never found any interesting article like yours.
It's pretty worth enough for me. Personally, if all site owners and bloggers made good
content material as you probably did, the net might be a lot more helpful than ever
before.

my website how You can help

Reply
avatar
Anonymous
December 29, 2013 at 7:48 AM delete

What you said made a great deal of sense.
However, what about this? what if you were to write a awesome headline?
I mean, I don't want to tell you how to run your blog,
but suppose you added a headline that makes people desire more?

I mean "Smooth Scroll To Top Button" is a little boring.
You should look at Yahoo's front page and see how they write post headlines to get people to open the links.

You might add a video or a related picture or two to grab people interested about everything've got to
say. Just my opinion, it could make your blog a little bit more
interesting.

Also visit my page find

Reply
avatar
Anonymous
February 16, 2014 at 1:49 AM delete

You really make it seem so easy with your presentation but I find this matter to be actually
something that I think I would never understand.
It seems too complicated and very broad for me.

I am looking forward for your next post, I'll try to get the
hang of it!

Feel free to visit my web site - citimortgage refinance rates

Reply
avatar
Anonymous
February 22, 2014 at 10:57 PM delete

I'm not sure where you're getting your information, but good topic.
I needs to spend some time learning more or understanding more.
Thanks for magnificent info I was looking for this information
for my mission.

Here is my web blog - see page

Reply
avatar
Anonymous
March 8, 2014 at 10:19 AM delete

Hurrah! After all I got a blog from where I be capable of really take useful facts regarding my study and
knowledge.

My web blog custom car mats

Reply
avatar
Anonymous
March 17, 2014 at 3:08 AM delete

That is a really good tip especially to those new to the blogosphere.
Brief but very accurate information? Thanks for sharing
this one. A must read post!

Also visit my blog post; description

Reply
avatar
Anonymous
March 20, 2014 at 7:02 PM delete

Hey there! I've been reading your weblog for a while now and finally got the courage to go ahead and give you a
shout out from Dallas Tx! Just wanted to tell you keep up
the great work!

My web site letterplates

Reply
avatar
Anonymous
May 18, 2014 at 3:32 AM delete

hi!,I like your writing so a lot! percentage we be in contact more
approximately your post on AOL? I need an expert on this area to unravel my problem.

May be that is you! Having a look ahead to
peer you.

Here is my weblog; as explained here

Reply
avatar
Anonymous
May 23, 2014 at 9:29 AM delete

Wonderful items from you, man. I have take into account your stuff previous to and you are simply too magnificent.
I actually like what you have acquired here, really like what you are
saying and the best way in which you assert it. You are
making it enjoyable and you still take care of to keep it
sensible. I cant wait to read much more from you. That is really a terrific web site.


Also visit my webpage - bob marley quotes

Reply
avatar
Anonymous
May 29, 2014 at 3:54 AM delete

We absolutely love your blog and find almost all of your post's to be precisely what
I'm looking for. Do you offer guest writers to write content for you personally?
I wouldn't mind composing a post or elaborating on many of the
subjects you write regarding here. Again, awesome blog!


Feel free to surf to my web page; breaking news

Reply
avatar
Anonymous
June 17, 2014 at 5:07 AM delete

Whats up this is kinda of off topic but I was wanting to
know if blogs use WYSIWYG editors or if you have to manually code with HTML.
I'm starting a blog soon but have no coding skills so I wanted to get advice from someone with experience.

Any help would be greatly appreciated!

Also visit my website - auto submit social bookmarking

Reply
avatar
Anonymous
June 20, 2014 at 1:53 AM delete

You can definitely see your expertise within the article you
write. The arena hopes for even more passionate writers
like you who aren't afraid to mention how they believe.

All the time follow your heart.

my web-site; social bookmarking websites

Reply
avatar
Anonymous
July 10, 2014 at 1:34 AM delete

I like the helpful info you provide in your articles. I'll bookmark your blog and check again
here frequently. I am quite certain I will learn many new stuff right here!
Best of luck for the next!

Feel free to visit my site ... official source

Reply
avatar
Anonymous
October 5, 2014 at 10:24 PM delete

Hey, I think your blog might be having browser compatibility issues.

When I look at your blog in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that, fantastic
blog!

Feel free to visit my blog; programa de dj

Reply
avatar
Anonymous
October 6, 2014 at 12:03 PM delete

I was able to find good info from your blog posts.

Take a look at my blog post - programa de dj

Reply
avatar
Anonymous
October 11, 2014 at 1:35 PM delete

Hey terrific website! Does running a blog similar
to this take a massive amount work? I have very little understanding
of programming but I had been hoping to start my own blog in the near future.
Anyhow, should you have any suggestions or techniques for
new blog owners please share. I understand this is off topic however I simply
had to ask. Appreciate it!

Check out my website programa de dj

Reply
avatar
Anonymous
October 13, 2014 at 9:08 PM delete

A motivating discussion is worth comment. I believe that you should write more about this issue,
it may not be a taboo subject but generally folks don't discuss such topics.
To the next! Many thanks!!

Also visit my webpage ... programa de dj ()

Reply
avatar
Anonymous
October 14, 2014 at 9:04 PM delete

Great post. I was checking constantly this blog and
I'm impressed! Very useful info specially the last part :) I care for such information a lot.
I was seeking this certain info for a very long time.

Thank you and good luck.

Visit my blog :: programa de dj

Reply
avatar
Anonymous
October 21, 2014 at 5:39 PM delete

Write more, thats all I have to say. Literally, it seems as though you relied on the video
to make your point. You obviously know what youre talking about,
why throw away your intelligence on just posting videos
to your blog when you could be giving us something informative to read?


my web page ... Learn HTML

Reply
avatar