Menu icon Foundation
Prohibit clicking outside of modal

I found the solution but I'm not sure where to put it or which class.

http://foundation.zurb.com/forum/posts/2127-prevent-modal-dialog-from-closing-when-clicking-anywhere-in-the-page

Basically, I don't want the modal to close when I click outside.

modal

I found the solution but I'm not sure where to put it or which class.

http://foundation.zurb.com/forum/posts/2127-prevent-modal-dialog-from-closing-when-clicking-anywhere-in-the-page

Basically, I don't want the modal to close when I click outside.

Bob Sawyer about 4 years ago

So, I think what you can do is, on the pages where you have the modal, include this wherever it is you initialize Foundation:

$(document).foundation({
      'reveal': { close_on_background_click: false }
});

Proof of concept:
http://codepen.io/bobsawyer/pen/LVWRXp

Onie Camara about 4 years ago

Oh cool! I'll try it now. Sorry. I got stuck on so many issues.

Onie Camara about 4 years ago

What if it's Angular, I just noticed it's Jquery?

Onie Camara about 4 years ago

I finally got it working with AngularJS,

I added backdrop : 'static' in $modal.open