How to implement JQuery easing into this window scroll movement function?
Posted
by Mohammad
on Stack Overflow
See other posts from Stack Overflow
or by Mohammad
Published on 2010-06-01T05:20:57Z
Indexed on
2010/06/01
5:23 UTC
Read the original article
Hit count: 425
With this code I've been able to capture the mousewheel movement and apply it to the horizontal scroll bars instead of the vertical default.
$('html').bind('mousewheel', function(event, delta) {
window.parent.scrollBy(-120 * delta, 0);
return false;
});
Is there any way that I could add this jQuery easing animation to the scroll movement?
jQuery.extend( jQuery.easing, {
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
});
Thank you so much in advance!
© Stack Overflow or respective owner