problem with the drop down menu with jquery
- by amir
Hi
Basically I have some links which include some other links, I'm trying to show the parent links only and when one clicks on the parent link the child links should appear and when one clicks on the parent link again the child link should disappear,
the code works for the first click and it opens the relevant child links but how do I make them disappear when I click on the parent link again,
thanks for the help.
jQuery.noConflict();
jQuery(document).ready(function(e) {
jQuery('.nav-container ul.level0 li.level1 a').click(function(e) {
e.preventDefault();
jQuery(this).css({'background':'#000000','color':'#ffffff'});
jQuery('.nav-container ul.level0 li.level2 a').css('display','block');
});
});