I am using tab menus, but with hover instead of clicks I currently have to use 'default' to close the menu.
- How can I start with all the drop-down menu?
- When the user presses the menu on the tabs should be expanded and only when the user exits the extended menu is closed.
Questions used:
$ (document) .ready (function () {$ (".menu"; li). Mouseover (function ("$ Default"): AddClass ("$ (" # Elec_gas "). RemoveClass (" active " ); $ ("# Home_energy"). RemoveClass ("active"); // Display selected division, other $ ("div.default") CSS ("display", "none"); $ ("div. Css ("display", "none"); $ ("div.home_energy"). Css ("display", "none" ("active"); $ ("# elec_gas"). AddClass ("Active"); $ ("#home_energy"). RemoveClass ("active"); // Display Selected Division; Hide others $ ("div.defa Ult"). CSS ("Display", "None"); $ ("Div .elec_gas ") fadein (). $ (" Div.home_energy "). Css (" display "," none "); breakage;} //alert(e.target.id); description is false;}) ;});
To turn them off, touch the child menu display Give a CSS of: None; or add it to your document, in script. Handler:
$ ("div.default, div.elec_gas, Div.home_energy"). to conceal (); To turn off a sealed hover-out ... use an event instead ... like:
$ (" Menuleave (function (e) { to:
is different from the mouseover event mouseup The way in which it handles event bubbling, if the mouseout is used in this example, the handler will trigger when the mouse pointer exits the inner element, usually the undesirable behavior. On the side, moussev The event only triggers its handler when the mouse leaves the element, it is not for lineage, therefore the handler in this example triggers when the mouse leaves external element , But internal element.
Comments
Post a Comment