I am encountering an issue with a menu div that starts off with opacity set to 0 and visibility hidden. The purpose is for this div to become visible when clicking on another div (a menu that sticks to the top of my page, toggle-able via click).
Everything works perfectly... the FIRST TIME...
When I click on "#menuIcon" the menu becomes available. I can show and hide it without any problems. However, after hiding the menu once, it remains hidden and cannot be made visible again. Can someone assist me in resolving this issue??
jQuery code
/* Toggles menu visibility on clicks */
$('#menuIcon').click(function () {
if ($('#menu ul').css('visibility') == 'hidden') {
$('#menu ul').css('visibility', 'visible');
$('#menu ul').animate({
opacity: 1
}, 500);
} else {
$('#menu ul').animate({
opacity: 0
}, 500,
function () {
$('#menu ul').css('visibility', 'hidden');
});
}
});