jquery Menu Plugin Superfish usage Guide

Source: Internet
Author: User

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.

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.