css - Scrollable Menu with Bootstrap 3 - Menu expanding its container when it should not -


i tried this method (their fiddle) enable scrollable menu bootstrap, approach, scrollable menu expands container -- fiddle -- non-scrollable menu, correctly, not this.

how can fix this? suggestions on other approaches compatible bootstrap appreciated too!


for reference, here html first method's fiddle:

<ul class="nav">     <li class="dropdown">         <a class="icon-key icon-white" data-toggle="dropdown" href="#" style=         "font-weight: bold"></a>          <div class="dropdown-menu" style="margin-left: 2em">             <ul class="dropdown-menu">                 <!-- static non-scrollable menu header 1 -->             </ul>         </div>          <div class="dropdown-menu" style="margin-left: 2em">             <ul class="dropdown-menu">                 <li class="disabled">                     <a href="#"><i class="icon-group"></i> <b>my groups</b></a>                 </li>                  <li>                     <div class="dropdown-menu scroll-menu scroll-menu-2x"                     style="margin-left: 2em">                         <ul class="dropdown-menu scroll-menu scroll-menu-2x">                             <li>                                 <a href="#">user</a>                             </li>                              <li>                                 <a href="#">administrators</a>                             </li>                              <li>                                 <a href="#">some other group</a>                             </li>                         </ul>                     </div>                      <ul class="dropdown-menu scroll-menu scroll-menu-2x">                         <!-- additional menu items omitted brevity -->                     </ul>                 </li>             </ul>         </div>          <div class="dropdown-menu" style="margin-left: 2em">             <ul class="dropdown-menu">                 <!-- static non-scrollable menu header 2 -->             </ul>         </div>          <div class="dropdown-menu" style="margin-left: 2em">             <ul class="dropdown-menu">                 <li class="disabled">                     <a href="#"><i class="icon-user"></i> <b>my roles</b></a>                 </li>                  <li>                     <div class="dropdown-menu scroll-menu scroll-menu-2x"                     style="margin-left: 2em">                         <ul class="dropdown-menu scroll-menu scroll-menu-2x">                             <li>                                 <a href="#">core users</a>                             </li>                              <li>                                 <a href="#">admin</a>                             </li>                              <li>                                 <a href="#">some other role</a>                             </li>                         </ul>                     </div>                      <ul class="dropdown-menu scroll-menu scroll-menu-2x">                         <!-- additional menu items omitted brevity -->                     </ul>                 </li>             </ul>         </div>          <div class="dropdown-menu" style="margin-left: 2em">             <ul class="dropdown-menu">                 <!-- static non-scrollable menu footer -->             </ul>         </div>          <ul class="dropdown-menu">             <li class="disabled">                 <a href="#"><i class="icon-chevron-up pull-left"></i> <i class="icon-chevron-up pull-right"></i></a>             </li>         </ul>     </li> </ul> 

and css:

/* wont impact original bootstrap menu or it's pseudo call-out arrow menu wrapped in sub dropdown-menu chained scroll-menu */ ul.scroll-menu {     position:relative;     display:inherit!important;     overflow-x:auto;     -webkit-overflow-scrolling:touch;     -moz-overflow-scrolling:touch;     -ms-overflow-scrolling:touch;     -o-overflow-scrolling:touch;     overflow-scrolling:touch;     top:0!important;     left:0!important;     width:100%;     height:auto;     max-height:500px;     margin:0;     border-left:none;     border-right:none;     -webkit-border-radius:0!important;     -moz-border-radius:0!important;     -ms-border-radius:0!important;     -o-border-radius:0!important;     border-radius:0!important;     -webkit-box-shadow:none;     -moz-box-shadow:none;     -ms-box-shadow:none;     -o-box-shadow:none;     box-shadow:none } 

i think can simplify adding necessary css properties special scrollable menu class..

css:

.scrollable-menu {     height: auto;     max-height: 200px;     overflow-x: hidden; } 

html

            <ul class="dropdown-menu scrollable-menu" role="menu">                 <li><a href="#">action</a></li>                 <li><a href="#">another action</a></li>                 <li><a href="#">something else here</a></li>                 <li><a href="#">action</a></li>                 ..                 <li><a href="#">action</a></li>                 <li><a href="#">another action</a></li>             </ul> 

working example: http://bootply.com/86116


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -