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

Expose columnizeIt, add Bootstrap 3 tabs workaround #136

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,16 @@ Columnizer will add CSS classes to the columns it creates. Each column will have
1. You can specify a rough width your columns, and Columnizer will create as many as will fit in the browser window. Just use: $(‘selector’).columnize({width: 400 }) syntax
2. You can specify a specific number of columns, and Columnizer will distribute your content between that many columns. Just use: $(‘selector’).columnize({columns: 2 }) syntax
3. When using the width and height options to scroll horizontally, make sure that the .column CSS class does not specify any padding or margin or border. See CSS for sample 5 for an example on how to create buffer between columns.
4. Make sure that you are columnizing visible content. If your content is display:none it may not columnize correctly. Try visibility:hidden and display:block instead.
4. Make sure that you are columnizing visible content. If your content is display:none it may not columnize correctly. Try visibility:hidden and display:block instead. Or see hint 6.
5. Columnizer does not auto-class any of your content. See the Suggested Defaults For Your Content section.

6. When columnized content is inside tabs (and thus display is none), then you can call columnize function right after tab content is shown. Example for Bootstrap 3 shown below.

```javascript
$(document).on("shown.bs.tab", function(event) {
var tabSelector = $(event.target).attr("href");
$(tabSelector).find(".columnize").each(function(){ $(@).data('columnizeIt')() });
});
```

### Suggested Defaults For Your Content

Expand Down
1 change: 1 addition & 0 deletions src/jquery.columnizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@
}
options.doneFunc();
}
$inBox.data('columnizeIt', columnizeIt); // expose columnize fn
});
};
})(jQuery);