Andreas Røste
Andreas Røste

Reputation: 64

jQuery Scroll animation speed

I am making an info screen in jQuery and need the animation speed to be evenly through the whole animation. I am using this code:

$("#panel1").animate({ 
    scrollTop: $("#panel1")[0].scrollHeight 
}, 100000);

Upvotes: 1

Views: 472

Answers (1)

Rory McCrossan
Rory McCrossan

Reputation: 337560

The third parameter of animate() is the easing to use. By default it's swing. You can change that to linear, like this:

$("#panel1").animate({ 
    scrollTop: $("#panel1")[0].scrollHeight 
}, 100000, 'linear');

Upvotes: 1

Related Questions