Menu icon Foundation
F6 - Stop Reveal Closing on Background Click?

I'm using Foundation 6.3.1 and I know you can prevent modals from closing when a background by setting this data option on the individual modal like so:

<div class="reveal" data-reveal data-options="closeOnClick:false;">...</div>

____

However, is there away to set this on ALL modals via javascript?

I've tried the below code based on the information found here - https://foundation.zurb.com/sites/docs/javascript.html#configuring-plugins

Foundation.Reveal.defaults.closeOnClick = false;

But unfortunately this does not seem to work.

Any info or suggestions on how to go about this would be awesome.

Thanks
> j

Foundation 6 Reveal

I'm using Foundation 6.3.1 and I know you can prevent modals from closing when a background by setting this data option on the individual modal like so:

<div class="reveal" data-reveal data-options="closeOnClick:false;">...</div>

____

However, is there away to set this on ALL modals via javascript?

I've tried the below code based on the information found here - https://foundation.zurb.com/sites/docs/javascript.html#configuring-plugins

Foundation.Reveal.defaults.closeOnClick = false;

But unfortunately this does not seem to work.

Any info or suggestions on how to go about this would be awesome.

Thanks
> j

jinch over 1 year ago

Thanks Chirag but not sure this will work for all modals. I'm looking for a more universal way to prevent this background click triggering the close of the modal on all of them - not just the ones with that data-option.

heatherknight12 over 1 year ago

hi how are you guys i learn alot from this forum

https://gogetdeals.co.uk