diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 46ecb15..4267379 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -123,12 +123,6 @@ var scrollTop = parseInt(scrollbarYTop * (contentHeight - containerHeight) / (containerHeight - scrollbarYHeight), 10); $this.scrollTop(scrollTop); - - if (isScrollbarXUsingBottom) { - $scrollbarXRail.css({bottom: scrollbarXBottom - scrollTop}); - } else { - $scrollbarXRail.css({top: scrollbarXTop + scrollTop}); - } }; var updateContentScrollLeft = function (currentLeft, deltaX) { @@ -147,12 +141,6 @@ var scrollLeft = parseInt(scrollbarXLeft * (contentWidth - containerWidth) / (containerWidth - scrollbarXWidth), 10); $this.scrollLeft(scrollLeft); - - if (isScrollbarYUsingRight) { - $scrollbarYRail.css({right: scrollbarYRight - scrollLeft}); - } else { - $scrollbarYRail.css({left: scrollbarYLeft + scrollLeft}); - } }; var getSettingsAdjustedThumbSize = function (thumbSize) { @@ -267,6 +255,7 @@ $(document).bind('mousemove' + eventClassName, function (e) { if ($scrollbarXRail.hasClass('in-scrolling')) { updateContentScrollLeft(currentLeft, e.pageX - currentPageX); + updateBarSizeAndPosition(); e.stopPropagation(); e.preventDefault(); } @@ -297,6 +286,7 @@ $(document).bind('mousemove' + eventClassName, function (e) { if ($scrollbarYRail.hasClass('in-scrolling')) { updateContentScrollTop(currentTop, e.pageY - currentPageY); + updateBarSizeAndPosition(); e.stopPropagation(); e.preventDefault(); }