reggaeboss — 2014-02-27T09:18:13-05:00 — #1
I am making a menu, and you can see what I have made so far in this fiddle
What I want to do is make it so that when I click the first <li> only the sub-menu for this <li> will show, and if I click another <li> I want this one the current one to close and show the new one. Atm clicking another wont close the previous.
Point me in the right direction?=)
patche — 2014-02-27T11:01:29-05:00 — #2
Try defining a global variable which stores the active li? Then when one is clicked, check that the global variable has a value, if it does, then hide the li and set the global variable to the new li.
The value should be that of the li that is clicked. I hope this makes sense XP
reggaeboss — 2014-02-27T15:45:13-05:00 — #3
Okey, could you show me how this could look? I am very new to jQuery, but trying to learn.
patche — 2014-02-28T08:34:27-05:00 — #4
reggaeboss — 2014-02-28T09:13:55-05:00 — #5
That is the same one as my fiddle above, did you maybe link the wrong one?=)