bootstrap3:hover下拉菜单

官方地址:https://github.com/CWSpear/bootstrap-hover-dropdown


1,下载及链接插件

   jQuery,bootstrap,bootstrap-hover-dropdown三个插件。<本测试基于bootstrap3.0.2>




2,使用

 1)自动启动

 class="dropdown">
     href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="false">
        Account  class="caret">
    
     class="dropdown-menu">
        
  • tabindex="-1" href="#">My Account
  • class="divider">
  • tabindex="-1" href="#">Change Email
  • tabindex="-1" href="#">Change Password
  • class="divider">
  • tabindex="-1" href="#">Logout
  •  2)通过js启动

    $('.dropdown-toggle').dropdownHover(options);

     Options

    • delay: 毫秒级延迟. This is the time to wait before closing a dropdown when the mouse is no longer over the dropdown or the button/nav item that activated it. Defaults to500.
    • instantlyCloseOthers: (optional) A boolean value that when true, will instantly close all other dropdowns matched by the selector used when you activate a new navigation. This is nice for when you have dropdowns close together that may overlap. Default is true.

    你可能感兴趣的:(bootstrap)