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.

enter image description here

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:

http://codepen.io/jasonespin/pen/zgqoba

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.

codepen demo


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -