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
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.