Check out this screenshot of a navbar PSD design I'm aiming for:
To make my navbar dropdown show up upon hovering, I've implemented the following JavaScript:
$('.navbar .dropdown').hover(function() {
$(this).find('.dropdown-menu').first().stop(true, true).slideDown(150);
}, function() {
$(this).find('.dropdown-menu').first().stop(true, true).slideUp(105)
});
Take a look at an example on bootply
However, when I click on a link in the dropdown menu, the main menu items lose their styles (color & border).
Any ideas on how to fix this?
Furthermore, do you have any suggestions on achieving the desired navbar dropdown as per the PSD file? My main issues are with the top and bottom borders of the dropdown list and main menu respectively.
I attempted to use the following CSS code to replicate the PSD design, but it didn't work:
#myNavbar ul li.dropdown a:hover,
#myNavbar ul li.dropdown a:active {
border-bottom-color: #fff;
background: #fff;
z-index: 1001;
position: static;
}
Your thoughts?