From 9420d1b6a9054d67d5680150cd947d09a887129a Mon Sep 17 00:00:00 2001 From: Oleg Kalistratov Date: Wed, 29 Jan 2014 13:06:27 +0400 Subject: [PATCH] Add 'includePadding' option (use container outerWidth/outerHeight instead of width/head) --- src/perfect-scrollbar.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index f17baa9..f73fcbd 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -25,7 +25,8 @@ suppressScrollX: false, suppressScrollY: false, scrollXMarginOffset: 0, - scrollYMarginOffset: 0 + scrollYMarginOffset: 0, + includePadding: false }; var getEventClassName = (function () { @@ -149,8 +150,8 @@ }; var updateBarSizeAndPosition = function () { - containerWidth = $this.width(); - containerHeight = $this.height(); + containerWidth = settings.includePadding ? $this.outerWidth() : $this.width(); + containerHeight = settings.includePadding ? $this.outerHeight() : $this.height(); contentWidth = $this.prop('scrollWidth'); contentHeight = $this.prop('scrollHeight');