Bootstrap to realize the mouse hanging stop pull menu and the Drop-down main menu can click Effect

Source: Internet
Author: User
Bootstrap is a very good front-end framework, but in the actual use of the process needs to be adjusted to the actual needs, such as we default to use the bootstrap frame pull-down menu when the main navigation is unable to click on the open page, and the Drop-down to expand the need to click the main menu, If we need to implement the main menu can be clicked Open, and the drop down menu to achieve the effect of hanging stop pull will need to adjust the JS script.
First, the implementation of suspended pull menu effect
1, modify the bootstrap.js document
2. Add script
The code is as follows Copy Code
$ (document). Ready (function () {
Dropdownopen ();
});
function Dropdownopen () {
var $dropdownLi = $ (' Li.dropdown ');
$dropdownLi. MouseOver (function () {
$ (this). addclass (' open ');
}). mouseout (function () {
$ (this). Removeclass (' open ');
});
}
After adding a script replacement, you can implement the mouse hover menu Drop-down effect.
Second, the realization of the main navigation can be clicked open
The code is as follows Copy Code
$ (document). Ready (function () {
$ (document). Off (' Click.bs.dropdown.data-api ');
});
Add script to bootstrap.js file, you can achieve the main navigation of the clickable open.
Summary, so that our bootstrap menu navigation can be implemented with mouse hover, as well as the main navigation of the Click Open.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.