javascript - Mega-menu - Cannot select child elements on hover -
i in process of adapting pretty stunning looking bootstrap mega menu responsive version. wish keep , feel of menu eye-catching menu makes use of bootstrap's dropdown-menu functionality meaning user must click reveal menu. in eyes not user experience on desktop many expect menu appear on hover. so, have adapted menu using following code ensure child elements of mega menu shown when user hovers on element on desktop:
@media screen , (min-width: 992px){ .mega-dropdown:hover .mega-dropdown-menu{ display: block; } } this great , achieves desired effect of revealing menu on hover on desktop when move mouse select menu items, menu disappears. believe because of gap present between link triggers child menu , top of child menu.

is there way in can cause menu stay open long enough user move child menu using html , css? know use javascript in eyes javascript should used sparingly , when necessary.
full code can found in codepen:
you need remove top margin , replace can on over transparent border.
.navbar-nav>li>.dropdown-menu { margin-top: 0; /* remove applied top margin */ border-top-left-radius: 4px; border-top-right-radius: 4px; border-top: 20px solid transparent; } note: i've not tested @ other widths have test if required @ all widths.
Comments
Post a Comment