From d14dfd307e87179ccdff9cac4d301555fd1860b4 Mon Sep 17 00:00:00 2001 From: Zeno Zeng Date: Fri, 14 Jun 2013 00:08:22 +0800 Subject: [PATCH] use scrollHeight & scrollWidth to avoid getting the wrong size of the content --- src/perfect-scrollbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index e2b8dcd..882d70e 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -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);