jquery-modal
jquery-modal copied to clipboard
$.modal.close() doesn't close modal
Hi there,
I'm trying to close the modal when the back button is pressed. This is my current code:
$(function() {
if (window.history && window.history.pushState) {
$(window).on('popstate', function() {
$.modal.close();
});
}
});
$.modal.close();
doesn't seem to be working here.
@steakscience I had this same issue. I found out it occurred because jquery already had another .modal function which was used to open the modal. It opens the modal but then doesn't appear correctly. What I ended up doing is replacing all .modal as a different variable