From aa56187a158ba23a00ef7562d4a4fe1e7cde4c18 Mon Sep 17 00:00:00 2001 From: roberttang30 Date: Fri, 19 Dec 2014 19:07:34 +0000 Subject: [PATCH] Update jquery.slimscroll.js Add an option matchParentHeight to give the choice of having the scroll area take the height of its parent when the height is set to auto. This is useful when you want to give the area a max-height so that it only scrolls when it is neccesary. --- jquery.slimscroll.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jquery.slimscroll.js b/jquery.slimscroll.js index 190368e..4a0f125 100644 --- a/jquery.slimscroll.js +++ b/jquery.slimscroll.js @@ -76,7 +76,10 @@ borderRadius: '7px', // sets border radius of the rail - railBorderRadius : '7px' + railBorderRadius : '7px', + + // whether the scroll div should take the height of its parent when the height is set to auto + matchParentHeight : true, }; var o = $.extend(defaults, options); @@ -151,7 +154,7 @@ } // optionally set height to the parent's height - o.height = (o.height == 'auto') ? me.parent().height() : o.height; + o.height = ((o.height == 'auto')&&(o.matchParentHeight === true)) ? me.parent().height() : o.height; // wrap content var wrapper = $(divS)