Open sheillendra opened 10 years ago
Here is my little hack to create an animated smoothTo scroll:
if (isJump)
{
delta = y;
var offsetTop = delta / me[0].scrollHeight * me.outerHeight();
offsetTop = Math.min(Math.max(offsetTop, 0), maxTop);
bar.css({ top: offsetTop + 'px' });
// tony's custom animation tweak
me.animate(
{ scrollTop: delta + 'px' },
1200
);
}
if (!isJump){
// scroll content
// tony's custom animation tweak
me.scrollTop(delta);
}
Is it possible to animate in scrollTo??