iPad Flicker on auto scroll using JQuery and Scrollto plugin iPad Flicker on auto scroll using JQuery and Scrollto plugin jquery jquery

iPad Flicker on auto scroll using JQuery and Scrollto plugin


If you need vertical scroll only, you could use {'axis':'y'} as settings to scrollTo method.

$.scrollTo(*selector*, *time*, {'axis':'y'});


Have you tried this:

$('a[href=#target]').    click(function(){        var target = $('a[name=target]');        if (target.length)        {            var top = target.offset().top;            $('html,body').animate({scrollTop: top}, 1000);            return false;        }    });


If you're just scrolling the page vertically you can replace the entire jQuery scrollTo plugin with this simple line:

$('html,body').animate({scrollTop: $("#scrollingTo").offset().top}, 1000, 'easeOutCubic');

Personally I do something like this

$('html,body').animate({scrollTop: $("#step-1").offset().top-15}, 1000, 'easeOutCubic',function(){  //do stuff});

I found that if I try to do other js work while it's scrolling it makes the browser crunch and the animation isn't smooth. But if you use the callback it'll scroll first, then do what you need.

I put a -15 at the end of .top because I wanted to show the top edge of the div I was scrolling do, simply for aesthetic purposes. 1000 is the duration in milliseconds of the animation.

Credit goes to the poster, animate, for the tip off.