How do I create a function that will close the bootstrap modal? I’ve created a bootstrap modal for my Google Maps API, which can be seen with this link: http://userpages.flemingc.on.ca/~eluli/modal.html
I want to make it possible for users to click on the x button to exit the modal, in order to access the map. I am not sure how to get it to close. Below is a snippet of my code:
/* The boostrap modal*/
.reveal-modal{
left: 50%;
margin-left: -300px;
width: 520px;
background: #eee;
position: absolute;
z-index: 101;
padding: 30px 40px 34px;
-webkit-box-shadow: 0 0 10px rgba(0,0,0,.4);
-box-shadow: 0 0 10px rgba(0,0,0,.4);
top: 100px; o
pacity: 1;
visibility: visible;
}
/* The close button */
.reveal-modal .close-reveal-modal {
font-size: 22px;
line-height: .5;
position: absolute;
top: 8px;
right: 11px;
color: #aaa;
text-shadow: 0 -1px 1px rbga(0,0,0,.6);
font-weight: bold;
cursor: pointer;
}
/*HTML of bootstrap modal*/
<div id="map" class="reveal-modal" style="top: 100px; opacity: 1; visibility: visible;">
/* close button*/
<a class="close-reveal-modal">✕</a>
<h1>Ontario Water Company and Electoral District Map</h1>
<p>This map provides information on stakeholders, companies and schools that affiliate with WaterTAP.</p>
<p>Note: the map information might have discrepancies since the boundaries of some electoral districts change when provincial elections occur. </p> </div>
<div class="reveal-modal-bg" style="display: block; cursor: pointer;"></div>