jQuery ScrollTo is a great way to smooth scroll to any jQuery/DOM element
$('#element).ScrollTo()
and your user will be smoothly scrolled to that element!duration
, easing
, and callback
on your ScrollTo call.Enough talk, let's see it in action!
$('#scrollto1').ScrollTo();
$('#scrollto2').ScrollTo({
duration: 2000,
easing: 'linear'
});
$('#scrollto3').ScrollTo({
duration: 2000,
durationMode: 'all'
});
$('#scrollto4').ScrollTo({
duration: 2000,
callback: function(){
alert('Scrolling has now completed.');
}
});
$('#scrollto5').ScrollTo();
$('#scrollto6').ScrollTo({
onlyIfOutside: true
});
jquery-scrollto
and move all the files and directories into that to continue.jquery-scrollto
which has a whole bunch of stuff in it, then that is fine and you can continue onto the next step.jquery-scrollto
then you must rename it to jquery-scrollto
to continue.jquery-scrollto
directory to somewhere on your webserverBe 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.
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>
<!-- Include jQuery ScrollTo -->
<script src="http://www.yoursite.com/somewhere/on/your/webserver/jquery-scrollto/lib/jquery-scrollto.js"></script>
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.
Licensed under the License.