About

jQuery ScrollTo is a great way to smooth scroll to any jQuery/DOM element

Enough talk, let's see it in action!

Using

#scrollto1:
$('#scrollto1').ScrollTo();
#scrollto2
$('#scrollto2').ScrollTo({
    duration: 2000,
    easing: 'linear'
});
#scrollto3
$('#scrollto3').ScrollTo({
    duration: 2000,
    durationMode: 'all'
});
#scrollto4
$('#scrollto4').ScrollTo({
    duration: 2000,
    callback: function(){
        alert('Scrolling has now completed.');
    }
});
#scrollto5
$('#scrollto5').ScrollTo();
#scrollto6
$('#scrollto6').ScrollTo({
    onlyIfOutside: true
});

Installation

Step 1. Download jQuery ScrollTo, and extract it to your hard drive

As everyones extraction process is a little bit different be sure of the following:

Step 2. Move the jquery-scrollto directory to somewhere on your webserver

Be sure to always keep the entire jquery-scrollto directory intact; this means if you were to only move some of the files instead of moving the entire directory, then you would run into problems due to the cross directory references would no longer be working.

Step 3. Include jQuery (insert into your page's head tag)

If your page already has jQuery included then you can skip this step.

<!-- Include jQuery (Dependency of jQuery ScrollTo) -->
<script src="http://www.yoursite.com/somewhere/on/your/webserver/jquery-scrollto/vendor/jquery.js"></script>

Step 4. Include jQuery ScrollTo (insert into your page's head tag)

<!-- Include jQuery ScrollTo -->
<script src="http://www.yoursite.com/somewhere/on/your/webserver/jquery-scrollto/lib/jquery-scrollto.js"></script>

Enjoy!!!

If anything isn't working the way you want it to, or if you would like to request a feature or provide praise or general feedback then be sure to click the feedback button to the right, or the "Get Support" link up the top of this page.

This work is powered by coffee and distributed for free. Donations are how we afford our coffee. Coffee is how we stay awake after our day job hours to work on things like this free open-source project which you're looking at. So go ahead, and get that warm fuzzy feeling knowing you just helped some poor fellow working after hours for free to buy his coffee. You only need to spare a few dollars, or as much as you feel this piece of work is worth. Thanks so much. Alternatively; if you are not in a donating mood, then spreading the word about this project on twitter, your blog, or whatever is just as good. You can also give praise by clicking the feedback button or visiting our "Get Support" link. Thanks a bunch, we appreciate the help deeply.

Paypal donation button

Licensed under the MIT License.