magnific popup modal closes on click

2019-09-05 23:15发布

问题:

I am trying to create a modal (won't close on 'esc' or 'click') popup with magnific popup. But for some reason, the popup closes on click or esc. I have followed examples here: http://jsfiddle.net/n6c5f/2/ and here: http://codepen.io/vemec/pen/JDsLl. Copying and pasting the exact code doesn't seem to work - the popup opens fine but closes on default events.

This is my current HTML:

<a href="#modal1" class="open-modal1">Open modal 1</a>

<div id="modal1" class="clean-modal mfp-hide">
TEST Modal popup
</div>

And JS:

jQuery('.open-modal1').magnificPopup({
type:'inline',
modal:true
});

Any thoughts?

回答1:

Updating to current version of Magnific popup solved the issue. Perhaps there was this was an issue w/ v0.8.7? Either way, resolved.