Forum Moderators: open
when it initiates the menu it hides all the sub uls. However I want to be able to over ride this sometimes and have one ul showing on initiation.
function initMenu() {
$('#menu ul').hide();
$('#menu li a').click(
function() {
var checkElement = $(this).next();
if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
checkElement.slideToggle('normal');
return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#menu ul:visible').slideUp('normal');
checkElement.slideDown('normal');
return false;
}
}
);
}
$(document).ready(function() {initMenu();});
[edited by: Sarah_Atkinson at 2:57 pm (utc) on Mar. 18, 2009]