Skip to content

Instantly share code, notes, and snippets.

@AaronLayton
Created June 10, 2014 09:44
Show Gist options
  • Save AaronLayton/e4c0a73cb19643a899a6 to your computer and use it in GitHub Desktop.
Save AaronLayton/e4c0a73cb19643a899a6 to your computer and use it in GitHub Desktop.
Bootstrap hover dropdowns
// This will add the 'open' class on hover to all dropdowns if the user is on a wide screen
// and then remove the 'open' class when you mouse out
$('.dropdown').hover(function () {
if ($(window).width() >= 768) {
$(this).toggleClass('open');
}
}, function () {
$(this).removeClass('open');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment