viewing paste Unknown #1350 | Javascript

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
//When the document is ready
$(document).ready(function(){
   
    //Hide all of the Sub Parent Elements in the Menu
    $("#menu li ul").hide();
   
    //If a Parent Element is being hovered over
    $("#menu li").hover(function(){
        //Have the Sub Parent Element slide out
        $("ul", this).stop().animate({height: 'show'}, {duration: 300, easing: 'easeOutQuint', queue: false, complete: function(){$(this).css("height", "auto");}});
    },    
    //When it is done hovering
    function(){
        //Have the Sub Parent Element slide back up
        $("ul",this).stop().animate({height: 'hide'}, {duration: 300, easing: 'easeInQuint', queue: false, complete: function(){$(this).css("height", "auto");}});  
        });
});
Viewed 711 times, submitted by Streusel.