use scrollHeight & scrollWidth to avoid getting the wrong size of the content

This commit is contained in:
Zeno Zeng
2013-06-14 10:13:30 +08:00
parent de6e4d59b0
commit d14dfd307e
+2 -2
View File
@@ -70,8 +70,8 @@
var updateBarSizeAndPosition = function () {
containerWidth = $this.width();
containerHeight = $this.height();
contentWidth = $content.outerWidth(false);
contentHeight = $content.outerHeight(false);
contentWidth = $this.prop('scrollWidth');
contentHeight = $this.prop('scrollHeight');
if (containerWidth < contentWidth) {
scrollbarXWidth = parseInt(containerWidth * containerWidth / contentWidth, 10);
scrollbarXLeft = parseInt($this.scrollLeft() * containerWidth / contentWidth, 10);