jquery - adding easing to a scrollbar plugin
I'm using this scrollbar plugin:
http://www.baijs.nl/tinyscrollbar/js/jquery.tinyscrollbar.js
and I want to add easing to it. I've isolated what I think is the function that calculates the movement, which is:
function drag(oEvent){
if(!(oContent.ratio >= 1)){
iPosition.now = Math.min((oTrack[options.axis] - oThumb[options.axis]), Math.max(0, (iPosition.start + ((sAxis ? oEvent.pageX : oEvent.pageY) - iMouse.start))));
开发者_开发技巧 iScroll = iPosition.now * oScrollbar.ratio;
oContent.obj.css(sDirection, -iScroll);
oThumb.obj.css(sDirection, iPosition.now);
}
return false;
};
How would I modify this to include a bit of easing?
精彩评论