jquery-modal icon indicating copy to clipboard operation
jquery-modal copied to clipboard

$.modal.close() doesn't close modal

Open steakscience opened this issue 5 years ago • 1 comments

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 avatar Aug 07 '19 07:08 steakscience

@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

willjk avatar Dec 11 '19 20:12 willjk