I use featherlight.js for lightbox. When it is opened and I click on it's background it cloeses popup. I need to disable this functionality. I noticed that this js has closeTrigger option in it but don't know how to use it.
disable closing popup when clicking on background
2.9k views Asked by aiddev At
4
There are 4 answers
1
On
I would suggest not to write javascript snippet separately as you already using "data" attributes to initialise the lightbox.
As per documentation provided, you can set data-featherlight-close-on-click="false" in markup itself to achieve the same.
Fiddle - http://jsfiddle.net/ylokesh/c5pq5bs1/2/
HTML
<a class="btn btn-default" href="#" data-featherlight-close-on-click="false" data-featherlight="#fl1">Default</a>
<div class="lightbox" id="fl1">
<h2>Featherlight Default</h2>
<p>
This is a default featherlight lightbox.<br>
It's flexible in height and width.<br>
Everything that is used to display and style the box can be found in the
</p>
<a href="https://github.com/noelboss/featherlight/blob/master/src/featherlight.css">featherlight.css</a> file which is pretty simple.
</div>
With this option, you will save writing separate script block just to enable this feature.
There is a default option in it:
Select "FALSE" value this will disable the closing of popup on clicking on background.