• 0

Simple dropdown click jQuery


Question

I'm not good at jQuery and would like to be able to click and the menu would drop down. I'm trying to do it but its not working. Here is my sample. Want to do it instead of hover so people can use it on menu.

 

http://cssdeck.com/labs/0pgruqby

Link to comment
https://www.neowin.net/forum/topic/1199315-simple-dropdown-click-jquery/
Share on other sites

9 answers to this question

Recommended Posts

  • 0
  On 05/02/2014 at 16:08, ACTIONpack said:

Yea, Trying to fix it now but no go. I made changes but not working.

Pretty simple and you can use slideToggle to cut down on your repetition too. Just add a class to your first unordered list and then change your jQuery to the following(i would target the list item as opposed to the anchor tag which you dont need):

$('ul.main li').click(function(){
     $(this).find('ul').slideToggle();
});
  • 0

Try that and still no go.

 

  On 05/02/2014 at 16:20, the better twin said:

 

Pretty simple and you can use slideToggle to cut down on your repetition too. Just add a class to your first unordered list and then change your jQuery to the following(i would target the list item as opposed to the anchor tag which you dont need):

$('ul.main li').click(function(){
     $(this).find('ul').slideToggle();
});
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.