Skip to content
Browse files

Scroll by 1px as a minimum. Closes #65

  • Loading branch information...
1 parent 60cb2c7 commit 7d64583b430bd6d0a93f27efedacacfb98e54816 @ept ept committed with vitch Apr 18, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 script/jquery.jscrollpane.js
View
4 script/jquery.jscrollpane.js
@@ -1205,6 +1205,8 @@
// the value of animateScroll from the settings object this jScrollPane was initialised with is used.
scrollByX: function(deltaX, animate)
{
+ // Scroll by at least one pixel (useful on sensitive trackpads)
+ deltaX = (deltaX >= 0) ? Math.max(deltaX, 1.0) : Math.min(deltaX, -1.0);
var destX = contentPositionX() + deltaX,
percentScrolled = destX / (contentWidth - paneWidth);
positionDragX(percentScrolled * dragMaxX, animate);
@@ -1213,6 +1215,8 @@
// the value of animateScroll from the settings object this jScrollPane was initialised with is used.
scrollByY: function(deltaY, animate)
{
+ // Scroll by at least one pixel (useful on sensitive trackpads)
+ deltaY = (deltaY >= 0) ? Math.max(deltaY, 1.0) : Math.min(deltaY, -1.0);
var destY = contentPositionY() + deltaY,
percentScrolled = destY / (contentHeight - paneHeight);
positionDragY(percentScrolled * dragMaxY, animate);

0 comments on commit 7d64583

Please sign in to comment.
Something went wrong with that request. Please try again.