Hide scrollbars while updating to stop affecting geometries.

Scrollbars keep affecting the geometries and it leads to wrong
scrollWidth and scrollHeight. So hide them in advance and show
them again after updating.
This commit is contained in:
Hyunje Alex Jun 2014-09-15 21:45:27 +01:00
parent 32a0caf2d8
commit 1d315786a0

View File

@ -201,6 +201,10 @@
};
var updateBarSizeAndPosition = function () {
// Hide scrollbars not to affect scrollWidth and scrollHeight
$scrollbarXRail.hide();
$scrollbarYRail.hide();
containerWidth = settings.includePadding ? $this.innerWidth() : $this.width();
containerHeight = settings.includePadding ? $this.innerHeight() : $this.height();
contentWidth = $this.prop('scrollWidth');
@ -238,6 +242,10 @@
}
updateScrollbarCss();
// Show scrollbars again after updated
$scrollbarXRail.show();
$scrollbarYRail.show();
};
var bindMouseScrollXHandler = function () {