From 99837518805f32898d80df5d9197ce027ed2492d Mon Sep 17 00:00:00 2001 From: Dj Gilcrease Date: Wed, 5 Dec 2012 19:18:01 -0500 Subject: [PATCH] Update src/jquery.columnizer.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option to useParentHeight as the target height of the container. If you have a fixed height parent with more then 1 column the math (targetHeight = maxHeight / numCols) breaks down --- src/jquery.columnizer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jquery.columnizer.js b/src/jquery.columnizer.js index ad75643..f7f2295 100644 --- a/src/jquery.columnizer.js +++ b/src/jquery.columnizer.js @@ -10,6 +10,8 @@ var defaults = { // default width of columns width: 400, + //This sets targetHeight to the parents height if it is true + useParentHeight:false, // optional # of columns instead of width columns : false, // true to build columns once regardless of window resize @@ -422,7 +424,9 @@ maxLoops = 1; targetHeight = optionHeight; scrollHorizontally = true; - } + } else if(options.useParentHeight) { + targetHeight = maxHeight; + } // // We loop as we try and workout a good height to use. We know it initially as an average