Question

I want to use the following jQuery script on my website:

$('#page2').ScrollTo({
    duration: 2000,
    easing: 'linear'
});"

The idea is to have button that redirects people to a div somewhere else on my page. I found the jQuery script above but have no clue where to put it..

Was it helpful?

Solution

I'm sorry I didn't get any more useful feedback. Eventually I exactly found what I was looking for on http://web.enavu.com/tutorials/how-to-jquery-scroll-to-anchor-and-scroll-to-top-simple/comment-page-1/

OTHER TIPS

Let's say you have a button with the id 'scroller', you would put something like the following on your page:

$(function(){
    $('#scroller').click(function(){
         $('#page2').scrollTo({
             duration: 2000,
             easing: 'linear'
         });
    });
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top