rivkamak
asked on
Close bootstrap modal window from anywhere
I have a page here that when I click an item it pops open 1 modal window.
If I add something to my cart, a second modal window opens.
How can I set it up that if you click anywhere outside the box it closes the window?
http://www.oorahauction.org/prizes.asp
If I add something to my cart, a second modal window opens.
How can I set it up that if you click anywhere outside the box it closes the window?
http://www.oorahauction.org/prizes.asp
Specify the "backdrop" option to true and not static
You'll see here that clicking the background closes the modal: http://jsbin.com/febohe/1/edit
Where is your code for calling the modal? The button should have the data-backdrop="true" attribute
in other words your <a>
<a class="portfolio-link" href="#" data-video="Ah-cLKaV_oM" data-image-id="1" data-prize-id="" data-toggle="modal" data-title="Hi-Tech" data-caption="Experience the future with an aerial camera Drone (it's a flying remote control video camera!), Google Glass, and an Apple Watch, plus ten Shabbos Zman light switches for your home." data-image="images/prizes1 5/lg/1.jpg " data-target="#image-galler y" data-backdrop="false">
<div class="portfolio-hover">
<div class="portfolio-hover-con tent">
<i class="fa fa-plus fa-3x"></i>
</div>
</div>
<img src="images/prizes15/med/1 .jpg" class="img-responsive" alt="Hi-Tech ">
</a>
<a class="portfolio-link" href="#" data-video="Ah-cLKaV_oM" data-image-id="1" data-prize-id="" data-toggle="modal" data-title="Hi-Tech" data-caption="Experience the future with an aerial camera Drone (it's a flying remote control video camera!), Google Glass, and an Apple Watch, plus ten Shabbos Zman light switches for your home." data-image="images/prizes1
<div class="portfolio-hover">
<div class="portfolio-hover-con
<i class="fa fa-plus fa-3x"></i>
</div>
</div>
<img src="images/prizes15/med/1
</a>
ASKER
It's actually just called directly from a different script:
$('#SuccessBox').modal('sh ow');
is it my modal box that needs to have the data-backdrop or the click script?
$('#SuccessBox').modal('sh
is it my modal box that needs to have the data-backdrop or the click script?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.