Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Farmatique/98390c7786af019d3f10fe7ad5404e96 to your computer and use it in GitHub Desktop.
Save Farmatique/98390c7786af019d3f10fe7ad5404e96 to your computer and use it in GitHub Desktop.
add/remove "expanded" class for mobile header by clicking on toogle-button (collapse/expand)
/* toggle class in header on expanding mobile menu */
jQuery('#bs-example-navbar-collapse-1').on('show.bs.collapse', function () {
jQuery('header').addClass('expanded');
})
jQuery('#bs-example-navbar-collapse-1').on('hide.bs.collapse', function () {
jQuery('header').removeClass('expanded');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment