Click here to Skip to main content
15,898,010 members
Articles / Web Development / HTML

Slide menu using JQuery

Rate me:
Please Sign up or sign in to vote.
3.67/5 (12 votes)
10 Jul 2008CPOL 106.4K   1.7K   38  
JavaScript slide menu with JQuery.
$(function() // Register the menu
      {
// Add the click event handler on the list item with sub list
$('li:has(ul)') 
               .click(function(event){
                if (this == event.target) {
                   // Hide all the children of the other lists
                   $('li:has(ul)').children().hide('slow'); 
                   // Make the animation
                   $(this).children().animate({opacity:'toggle',height:'toggle'},'slow'); 
                                          }
                         return false;
                                     }
                       )
                // Change the cusrsor.
               .css({cursor:'pointer'})
               // Hide all the nested lists (on the first tinm only).
               .children().hide();
       }
 );
    

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect INC Technologies
Kuwait Kuwait
+7 years of experience in designing and implementing Microsoft Based Solutions.
+5 years of experience in SharePoint implementations from MCMS 2002 to the latest version.
+3 years of experience as presales and technology advisory.
Strong analytic, design and client facing skills.
Strong record in consultation and presales with associated Gulf business understanding and market analysis.
Worked closely with Microsoft Kuwait & Qatar Offices SSPs, PTAs, PAMs and SAMs.
Extensive experience in BizTalk Server 2009, SSAS, PerformancePoint Services and Excel Services.
Active member in the Virtual Technology Specialist and Customer Immersion Experience programs.
Strong record in team leading and projects supervision.

Comments and Discussions