Finally found a Jquery scroll to div(!)... now to add easing..?

Go To StackoverFlow.com

1

http://subzerostudio.com/temp/verticalscroller/scroller/scroller.html

Here's the fullscreen vertical scrolling site.. I've only tested it in FF so could well be buggy..

Assuming it actually works, I now want to add easing and speed, I've tried this:

    $('html,body').animate({
        duration: 6000,
        easing: 'easeOutElastic',
        scrollTop: $("#"+id).offset().top}
        );

but the duration has no effect and easing doesn't seem to be working either.. any ideas?

2012-04-04 22:41
by Chris Carruthers


2

Your animation syntax is incorrect.

$('html body').animate({
    scrollTop: $("#"+id).offset().top
}, 6000, 'easeOutElastic');

As you have it, you're telling jQuery to animate the duration and easing properties of the body, which don't exist.

http://api.jquery.com/animate/

2012-04-04 22:54
by zim2411
awesome thank you - Chris Carruthers 2012-04-04 23:02
use the selector 'html,body' not 'html body' if it should work in IE and FF, the space-one only works in webkit-browsers (like GC), the comma-one in all (the ones I've tried) - flowtron 2015-04-17 10:59
Ads