Skip to content

Instantly share code, notes, and snippets.

@josephmosby
Created November 21, 2013 21:08
Show Gist options
  • Save josephmosby/7589654 to your computer and use it in GitHub Desktop.
Save josephmosby/7589654 to your computer and use it in GitHub Desktop.
Adjust menus to be table-cell or inline-block depending on height
function checkWidth() {
var windowSize = jQuery(window).width();
if (windowSize > 660) {
jQuery("#main-menu").css('display', 'table-row');
jQuery("#main-menu li").css('display', 'table-cell');
} else {
jQuery("#main-menu").css('display', 'inline');
jQuery("#main-menu li").css('display', 'inline-block');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment