Last active
August 29, 2015 14:05
-
-
Save jmcclellan/0bac8e04bccc48543dad to your computer and use it in GitHub Desktop.
Open nav menu on hover instead of click when using the Roots framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add open class to dropdown menu when hovered over | |
$(function() { | |
$(".dropdown").hover( | |
function(){ $(this).addClass('open'); }, | |
function(){ $(this).removeClass('open'); } | |
); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* show the child dropdown menu on hover of parent */ | |
ul.nav li.dropdown:hover > ul.dropdown-menu { | |
display: block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment