Ali Nouman
Ali Nouman

Reputation: 3414

hover function on parent,navigation menus jquery

i am creating navigation menus like this site http://demo.megathe.me/skylab/ and i m completely lost after reaching this http://jsfiddle.net/jxU95/. Any help? this is my js code

   $('#main-menu li.expanded > a').hover(function(){
                $(this).next().show('slow');
        },
        function(){
             //    $(this).next().hide();
        }
    );

Upvotes: 0

Views: 65

Answers (2)

Adil
Adil

Reputation: 148150

You can do it with some like this,

Live Demo

$('#main-menu li.expanded').hover(function () {
   // $('#main-menu ul ul').hide();
   $(this).find('.menu').show('slow');
}, function () {
   $(this).find('.menu').hide();
});

Upvotes: 1

Hushme
Hushme

Reputation: 3144

try this code in js http://jsfiddle.net/jxU95/1/

   $('#main-menu li.expanded').hover(function(){
                $(this).find('ul').stop(true,true).show('slow');
        },
        function(){
              $(this).find('ul').stop(true,true).delay(300).hide('slow');
        }
    );

Upvotes: 1

Related Questions