From 627b6a6b8190942827bd2c5780da753619e81bf0 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 9 Feb 2013 15:17:42 +1000 Subject: [PATCH] Take into account padding and margins on content Changed the height and widths calculations of the content div to include any padding and/or margins. outerHeight(true) is changed to outerHeight(false). outerWidth is changed as same. Fixed by noraesae. --- 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 7886d0f..8ca1000 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -51,8 +51,8 @@ var updateBarSizeAndPosition = function() { container_width = $this.width(); container_height = $this.height(); - content_width = $content.width(); - content_height = $content.height(); + content_width = $content.outerWidth(false); + content_height = $content.outerHeight(false); if(container_width < content_width) { scrollbar_x_width = parseInt(container_width * container_width / content_width); scrollbar_x_left = parseInt($this.scrollLeft() * container_width / content_width);