admin管理员组

文章数量:1356566

I created jquery dropdown menu like this. I want to add slide effect on drop down menu. At the same time if I am placing my mouse over my menu tab the sub menu was opened now it is looking like one step up pare to the menu tab. I need slide like this. I here added my script.

function mainmenu() {
    jQuery(" #na1").hover(function () {
//alert("hai-2");
        jQuery(this).find('#content1').slideDown("fast");
    }, function () {
        jQuery(this).find('#content1').slideUp("fast");
    });
}

$(document).ready(function () {
    mainmenu();
});

I created jquery dropdown menu like this. I want to add slide effect on drop down menu. At the same time if I am placing my mouse over my menu tab the sub menu was opened now it is looking like one step up pare to the menu tab. I need slide like this. I here added my script.

function mainmenu() {
    jQuery(" #na1").hover(function () {
//alert("hai-2");
        jQuery(this).find('#content1').slideDown("fast");
    }, function () {
        jQuery(this).find('#content1').slideUp("fast");
    });
}

$(document).ready(function () {
    mainmenu();
});
Share Improve this question edited Nov 14, 2024 at 1:11 Danny Beckett 20.9k26 gold badges113 silver badges142 bronze badges asked Apr 9, 2014 at 7:29 GaneshGanesh 272 silver badges8 bronze badges 2
  • could you be more clear about what you are expecting ? – dreamweiver Commented Apr 9, 2014 at 7:32
  • I think this site provides the solution: onextrapixel./2011/06/03/… – jyotesh Commented Apr 9, 2014 at 7:36
Add a ment  | 

4 Answers 4

Reset to default 5
$(document).ready(function () {
    $("#na ul li").hover(function () {
         $(this).siblings().find('ul').slideUp(400);
         $(this).find('ul').slideDown(400);        
    }, function () {
       $(this).find('ul').slideUp(400);
    });
});

Demo:

http://jsfiddle/QkbDg/1/

Try this

$(document).ready(function () {
    jQuery("#na ul li a").hover(function () {
        jQuery(this).next('ul').slideDown(350);
    }, function () {
        jQuery(this).next('ul').slideUp(350);
    });
});

DEMO

Try this:

function mainmenu(){
    jQuery(" #na1").hover(function(){
        jQuery(this).find('#content1').stop().slideDown("fast");
    },function(){
        jQuery(this).find('#content1').stop().slideUp("fast");
    });
}

$(document).ready(function()
{
    mainmenu();
}); 

Try this

function mainmenu(){
jQuery(".topm").hover(function(){
//alert("hai-2");
jQuery(this).find('.content').stop().slideDown("fast")
},function(){
jQuery(this).find('.content').stop().slideUp("fast");
});
}

$(document).ready(function()
{
mainmenu();
}); 

Demo : here

本文标签: javascriptJQuery slide effects on drop down menuStack Overflow