douban-client
  • 用户
  • 广播
  • Dropdowns
  • Button groups
  • Button dropdowns
  • Navs
  • Navbar
  • Breadcrumbs
  • Pagination
  • Labels and badges
  • Typography
  • Thumbnails
  • Alerts
  • Progress bars
  • Media object
  • Misc

Dropdown menus

Example

Toggleable, contextual menu for displaying lists of links. Made interactive with the dropdown JavaScript plugin.

  • Action
  • Another action
  • Something else here
  • Separated link
  1. this is line in li
  1. <div class="dropdown">
  2. <!-- Link or button to toggle dropdown -->
  3. <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  4. <li><a tabindex="-1" href="#">Action</a></li>
  5. <li><a tabindex="-1" href="#">Another action</a></li>
  6. <li><a tabindex="-1" href="#">Something else here</a></li>
  7. <li class="divider"></li>
  8. <li><a tabindex="-1" href="#">Separated link</a></li>
  9. </ul>
  10. </div>

Options

Align menus to the right and add include additional levels of dropdowns.

Aligning the menus

Add .pull-right to a .dropdown-menu to right align the dropdown menu.

  1. <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel">
  2. ...
  3. </ul>

Disabled menu options

Add .disabled to a <li> in the dropdown to disable the link.

  • Regular link
  • Disabled link
  • Another link
  1. <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
  2. <li><a tabindex="-1" href="#">Regular link</a></li>
  3. <li class="disabled"><a tabindex="-1" href="#">Disabled link</a></li>
  4. <li><a tabindex="-1" href="#">Another link</a></li>
  5. </ul>

Sub menus on dropdowns

Add an extra level of dropdown menus, appearing on hover like those of OS X, with some simple markup additions. Add .dropdown-submenu to any li in an existing dropdown menu for automatic styling.

Default

  • Action
  • Another action
  • Something else here
  • More options
    • Second level link
    • Second level link
    • Second level link
    • Second level link
    • Second level link

Dropup

  • Action
  • Another action
  • Something else here
  • More options
    • Second level link
    • Second level link
    • Second level link
    • Second level link
    • Second level link

Left submenu

  • Action
  • Another action
  • Something else here
  • More options
    • Second level link
    • Second level link
    • Second level link
    • Second level link
    • Second level link
  1. <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  2. ...
  3. <li class="dropdown-submenu">
  4. <a tabindex="-1" href="#">More options</a>
  5. <ul class="dropdown-menu">
  6. ...
  7. </ul>
  8. </li>
  9. </ul>
  • caijiehong