Skip to content

Instantly share code, notes, and snippets.

@mofodox
Created September 11, 2017 07:05
Show Gist options
  • Save mofodox/b1bad1f36ecfc624c6467e840692837a to your computer and use it in GitHub Desktop.
Save mofodox/b1bad1f36ecfc624c6467e840692837a to your computer and use it in GitHub Desktop.
jQuery(document).ready(function () {
/*
OFF CANVAS - SIDEBAR TOGGLE
*/
jQuery('[data-toggle="offcanvas"]').click(function () {
jQuery('.row-offcanvas').toggleClass('active');
});
/*
MENU DROPDOWN - NEXT LEVEL HOVER
*/
jQuery(".dropdown").hover(function() {
jQuery(this).find('.dropdown-menu').first().stop(true, true).fadeIn("fast");
}, function() {
jQuery(this).find('.dropdown-menu').first().stop(true, true).fadeOut("fast");
});
/* WINDOW RESIZE FUNCTION */
jQuery( window ).resize(function() {
/*
ABOVE 980px, Remove Off-Canvas Sidebar
*/
if(jQuery( window ).width() >= 980) {
jQuery('body > div.nus-body-container').removeClass('active');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment