I am using the code below to show and hide a div called “map”
When a link with id ‘goo’ is clicked the map is shown using .slideDown, but when the link is clicked again it is SUPPOSE to use .slideUp to hide the map but nothing happens.
Here is the Javascript:
$('#goo').live('click',function() {
if ($("#map").css('visibility','hidden')){
$('#map').slideDown('slow');
$("#map").css('visibility','visible');
$("#map").css('position','relative');
} else {
$('#map').slideUp('slow');
}
return false;
});
If anyone has any idea where the div won’t slide up, let me know!
to answer your question why it doesn’t work…your if condition needs to be changed… else everything else is good…. you need to check
else its good
check out the fiddle for the same http://jsfiddle.net/xsFRJ/