Using the bootstrap-hover-dropdown Plugin
1. Download bootstrap-hover-dropdown
Download link: http://www.bootcdn.cn/bootstrap-hover-dropdown/
Of course, you can also use the CDN version directly.
2. Include bootstrap-hover-dropdown.js
In your HTML file, make sure to include bootstrap-hover-dropdown.js. Typically, you can place it in a <script> tag at the bottom of the page:
| |
3. Modify the Dropdown in HTML
Find the element with the dropdown-toggle class in your HTML file and modify it as follows:
| |
Change it to:
| |
You can also add a parameter data-delay="1000", which sets the delay before the dropdown disappears (default is 500 milliseconds). For example:
| |
4. Removing the Delay
If you want to completely remove the delay, you can directly modify the configuration in the bootstrap-hover-dropdown.js file, changing delay: 500 to delay: 0.
Find and modify the following code:
| |
Change it to:
| |
This will remove the dropdown menu delay.