Separate the function updating the css of scrollbars.

This commit is contained in:
Hyunje Alex Jun 2013-06-16 17:45:37 +09:00
parent e833f42d02
commit 21d5d4ab63

View File

@ -66,6 +66,11 @@
$scrollbarY.css({right: scrollbarYRight - scrollLeft}); $scrollbarY.css({right: scrollbarYRight - scrollLeft});
}; };
var updateScrollbarCss = function () {
$scrollbarX.css({left: scrollbarXLeft + $this.scrollLeft(), bottom: scrollbarXBottom - $this.scrollTop(), width: scrollbarXWidth});
$scrollbarY.css({top: scrollbarYTop + $this.scrollTop(), right: scrollbarYRight - $this.scrollLeft(), height: scrollbarYHeight});
};
var updateBarSizeAndPosition = function () { var updateBarSizeAndPosition = function () {
containerWidth = $this.width(); containerWidth = $this.width();
containerHeight = $this.height(); containerHeight = $this.height();
@ -97,8 +102,7 @@
scrollbarXLeft = containerWidth - scrollbarXWidth; scrollbarXLeft = containerWidth - scrollbarXWidth;
} }
$scrollbarX.css({left: scrollbarXLeft + $this.scrollLeft(), bottom: scrollbarXBottom - $this.scrollTop(), width: scrollbarXWidth}); updateScrollbarCss();
$scrollbarY.css({top: scrollbarYTop + $this.scrollTop(), right: scrollbarYRight - $this.scrollLeft(), height: scrollbarYHeight});
}; };
var moveBarX = function (currentLeft, deltaX) { var moveBarX = function (currentLeft, deltaX) {