jquery Menu Plugin Superfish usage Guide
Superfish is a jquery plug-in, it is very easy to build a complex multi-level Pull-down menu, Superfish use is also very common. You may use Superfish to achieve a variety of menu effects.
Some characteristics and effects of Superfish:
Use pure CSS to achieve dynamic effects, cross-browser, support the worst browser IE6
You can set the Drop-down menu to automatically hide the time when the mouse leaves. The default is 800 milliseconds
Support Fade animation
Support for keyboard responses
Automatically add a hint arrow to a parent menu containing a submenu
Supports shadow effects, but requires good browser support, such as firefox,chrome ... The worst browser IE6 is free.
Optional callback JS function
Instructions for use
1, 1. First, introduce jquery and Superfish files to the page
?
1 2 |
<script src= "Jquery.js" type= "Text/javascript" ><!--mce:0--></script> <script src= " Superfish.js "type=" Text/javascript "><!--mce:1--></script> |
2, 2. Second, use the UL Li to do the menu content
?
1 2 3 4 5 6 7 8 9 10 11 |
<ul class= "Sf-menu" > <li><a href= "#aa" >menu item This is quite long</a></li>, <li class= "Current" > <a href= "#ab" >menu item→</a> <ul> <li class= "current" ><a href= "#" >menu item</a></li> <li><a href= "#aba" >menu item</a></li> <li><a href= "#abb" >menu item</a></li> </ul> </li> </ul> |
3, finally, create the initialization menu and set the effect
?
1 2 3 4, 5 6 7 8 9 10 11 12 13 14 15 |
$ (document). Ready (function () {$ ("Ul.sf-menu"). Superfish ({hoverclass: ' sfhover ',//when the mouse hovers over the class Pathclass: ' Overidethistouse ',//activated menu item Class pathlevels:1,//Menus series delay:800,//pull-down menu automatically hides time when the mouse is left. The default is 800 milliseconds animation: {opacity: ' Show '},//animation effect, reference jquery's animated jquery ' s. Animate () Speed: ' normal ',///animation speed, Refer to jquery's animated jquery ' s. Animate () Dropshadows:true,//shadow effect, close with ' false ' Oninit:function () {},///initialization callback function Onbeforeshow:func tion () {},//submenu display before callback function onshow:function () {},//submenu display callback function Onhide:function () {}//submenu hidden callback function}); }); |
The above mentioned is the entire content of this article, I hope you can enjoy.