Skip to content

Instantly share code, notes, and snippets.

@jimmynotjim
Created September 7, 2012 13:59
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmynotjim/3666470 to your computer and use it in GitHub Desktop.
Save jimmynotjim/3666470 to your computer and use it in GitHub Desktop.
Use Modernizr to conditionally use Columnizer.js when css columns aren't supported
<script type="text/javascript">
//
// Requires Modernizr, jquery, and columnizer.js
// http://modernizr.com (Requires a production version, demo doesn't include yep/nope)
// http://jquery.com
// http://welcome.totheinter.net/columnizer-jquery-plugin/
//
// Replace [url], [target], and [options] w/ your specific needs
//
Modernizr.load({
test: Modernizr.csscolumns,
nope: '[url]/jquery.columnizer.min.js',
complete: function() {
if ($('html').hasClass('no-csscolumns')) {
$('[target]').columnize({[options]});
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment