node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »


Bootstrap Dropdown Hover Build Status

Bootstrap Dropdown Hover is a simple plugin which opens Bootstrap dropdown menus on mouse hover, the proper way.

Check the official website for a demo.


  1. Download the latest tag from the releases page or get it via bower:
$ bower install bootstrap-dropdown-hover
  1. Include jQuery and Bootstrap:
<link rel="stylesheet" href="//">
<script src="//"></script>
<script src="//"></script>
  1. Include plugin's code:
<script src="dist/jquery.bootstrap-dropdown-hover.min.js"></script>
  1. Call the plugin:

Initiate on all dropdowns/dropups method 1

  // see next for specifications 

Initiate on all dropdowns/dropups method 1

  // see next for specifications 

Initiate on navbar menu only

$('.navbar [data-toggle="dropdown"]').bootstrapDropdownHover({
  // see next for specifications 


Initialization parameters object

When calling bootstrapDropdownHover() you can pass a parameters object with zero or more of the following:

  • clickBehavior, 'sticky'|'default'|'disable', defaults to sticky, which means that if we click on an opened dropdown then it will not hide on mouseleave but on a second click only. Can be default, which means that means that the dropdown toggles on hover and on click too, or disable, which disables dropdown toggling with clicking when mouse is detected (so it will open on hover only)
  • hideTimeout, integer, defaults to 200, how much time the hovered dropdown hides after mouseleave (in milliseconds).


You can modify the behavior of the plugin by calling its methods, all of which accept a value.

To call methods on any dropdown hover instance, use the following syntax:

$(selector).bootstrapDropdownHover(methodName, parameter);

Here are the available methods:

  • setClickBehavior(value) to change the clickBehavior parameter.
  • setHideTimeout(value) to change the hideTimeout parameter.

Furthermore, you can call:

  • destroy() to restore the original behavior.


The basic structure of the project is given in the following way:

├── dist/
│   ├── jquery.bootstrap-dropdown-hover.js
│   └── jquery.bootstrap-dropdown-hover.min.js
├── src/
│   └── jquery.bootstrap-dropdown-hover.js
├── .editorconfig
├── .gitignore
├── .jshintrc
├── .travis.yml
├── bootstrap-dropdown-hover.jquery.json
├── bower.json
├── Gruntfile.js
├── index.html
└── package.json


This is where the generated files are stored once Grunt runs.


Contains the source file.


This file is for unifying the coding style for different editors and IDEs.

Check if you haven't heard about this project yet.


List of files that we don't want Git to track.

Check this Git Ignoring Files Guide for more details.


List of rules used by JSHint to detect errors and potential problems in JavaScript.

Check if you haven't heard about this project yet.


Definitions for continous integration using Travis.

Check if you haven't heard about this project yet.


Package manifest file used to publish plugins in jQuery Plugin Registry.

Check this Package Manifest Guide for more details.


Contains all automated tasks using Grunt.

Check if you haven't heard about this project yet.


Specify all dependencies loaded via Node.JS.

Check NPM for more details.


To build and test the plugin, you need:

  • NodeJS with npm
  • bower (install it with npm install bower --g)
  • grunt-cli (install it with npm install grunt-cli --g)

Then, cd to the project directory and install the required dependencies:

$ npm install
$ bower install

To run jshint on the plugin code, call:

$ grunt jshint

To build the output js and css files, with the related minified ones, run:

$ grunt

Issues and Contributions

You can report any issue you may encounter on the GitHub Issue Tracker.

To contribute, please follow the contribution guidelines.


Check Release list.


  Copyright 2015 István Ujj-Mészáros
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  See the License for the specific language governing permissions and
  limitations under the License.