Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added maxColWidth parameter #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/jquery.columnizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
width: 400,
// optional # of columns instead of width
columns : false,
// Optional, The width of a column can grow to maxColWidth (padding included!).
// Columns will be added if the the container is wider
maxColWidth:false,
// true to build columns once regardless of window resize
// false to rebuild when content box changes bounds
buildOnce : false,
Expand Down Expand Up @@ -433,6 +436,13 @@
numCols = $cache.find(prefixTheClassName("columnbreak", true)).length + 1;
optionWidth = false;
}

if ( options.maxColWidth ){
numCols=1;
while ( ( numCols * options.maxColWidth ) < $inBox.width() ) {
++numCols;
}
}

// if ($inBox.data("columnized") && numCols == $inBox.children().length) {
// return;
Expand Down