Skip to content

Commit 9983751

Browse files
author
Dj Gilcrease
committed
Update src/jquery.columnizer.js
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
1 parent 6eb3e3a commit 9983751

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/jquery.columnizer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
var defaults = {
1111
// default width of columns
1212
width: 400,
13+
//This sets targetHeight to the parents height if it is true
14+
useParentHeight:false,
1315
// optional # of columns instead of width
1416
columns : false,
1517
// true to build columns once regardless of window resize
@@ -422,7 +424,9 @@
422424
maxLoops = 1;
423425
targetHeight = optionHeight;
424426
scrollHorizontally = true;
425-
}
427+
} else if(options.useParentHeight) {
428+
targetHeight = maxHeight;
429+
}
426430

427431
//
428432
// We loop as we try and workout a good height to use. We know it initially as an average

0 commit comments

Comments
 (0)