Hello
I have this javascript menu, using css and javascript, but i have a small thing im not sure of, i have the menu to open when u click it and then close and open another menu when the other one is clicked.
but i want the menu to open when u click on it and then close when u click on it again.
This is my code:
function initMenu() {
$('#menu ul').hide();
//$('#menu ul:first').show();
$('#menu li a').click(a
function() {
var checkElement = $(this).next();
//checkElement.slideToggle('normal');
if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#menu ul:visible').slideUp('normal');
checkElement.slideDown('normal');
return false;
}
}
);
}
$(document).ready(function() {initMenu();});