Skip to content Skip to sidebar Skip to footer

Jquery - How To Show A Hidden Div

I have a google map embedded in my page whose visiblity is set to hidden. Using a button i want to show the map on the page. Should be done using jquery. my code - (not working) &l

Solution 1:

Try

$('#map').css('visibility','visible');

Actually, if style has display:none, you can use jquery function

$('#map').show();

Solution 2:

Your style="" tag is also incorrect. You should have this: visibility: hidden;

Try this:

<div id="map" style="height: 350px; border: 1px solid #979797; display: none";></div>

$("#map").show();

Solution 3:

Here is a jsfiddle: http://jsfiddle.net/lucuma/GhMbU/

$('div#map').css('visibility', 'visible')


Solution 4:

But visibility:hidden is better than display:none if you want to use jQuery to hide it. Because jQuery's .show() function overlays some of the page elements like anchor tags, preventing click events.


Post a Comment for "Jquery - How To Show A Hidden Div"