Merge pull request #36 from zenozeng/master

Use prop('scrollWidth') and prop('scrollHeight') instead of outerWidth() and outerHeight() to get the content size.
This commit is contained in:
Hyunje Alex Jun 2013-06-14 05:32:44 -07:00
commit a8db04e41d

View File

@ -70,8 +70,8 @@
var updateBarSizeAndPosition = function () { var updateBarSizeAndPosition = function () {
containerWidth = $this.width(); containerWidth = $this.width();
containerHeight = $this.height(); containerHeight = $this.height();
contentWidth = $content.outerWidth(false); contentWidth = $this.prop('scrollWidth');
contentHeight = $content.outerHeight(false); contentHeight = $this.prop('scrollHeight');
if (containerWidth < contentWidth) { if (containerWidth < contentWidth) {
scrollbarXWidth = parseInt(containerWidth * containerWidth / contentWidth, 10); scrollbarXWidth = parseInt(containerWidth * containerWidth / contentWidth, 10);
scrollbarXLeft = parseInt($this.scrollLeft() * containerWidth / contentWidth, 10); scrollbarXLeft = parseInt($this.scrollLeft() * containerWidth / contentWidth, 10);