1

Please help, when I click the link and a popup will show up. When I then click on the content page block, the popup will close suddenly.

I already tired to add modal: true, and this works, but I cannot close the popup so I need another solution. please thanks in advance.

<a class="simple-ajax-popup-align-top" href="htmlcontent.html">Popup</a> 


$(document).ready(function() {
    $('.simple-ajax-popup-align-top').magnificPopup({
        type: 'ajax',
        alignTop: false,
        overflowY: 'scroll',
        preloader: true,
        midClick: true,
        closeOnContentClick: false,
        enableEscapeKey: true,
        showCloseBtn: false,
        mainClass: 'mfp-fade',
        callbacks: {
          close: function() {
            // nothing
          }
        }
    });
});
Pete
  • 57,112
  • 28
  • 117
  • 166
Tim Tawan
  • 11
  • 4

1 Answers1

0

I had the same problem, solved it by using:

modal:true,

instead of:

closeOnContentClick: false,

or

set closeOnBgClick: false instead of modal:true

For more information click here

Community
  • 1
  • 1
Jigs Virani
  • 4,067
  • 1
  • 23
  • 24
  • Thanks you so much, but I already tested all your solution but still doesn't work. I put modal: true the popup can not close by clicking on background or try to add CloseButton still no work, even close button didn't show up – Tim Tawan Jul 15 '15 at 10:22
  • @TAWAN I have updated my answer, So you can get solution.I hade same problem with this but I sort out with this.If you still not get out from it.Please check another code.Thanx – Jigs Virani Jul 15 '15 at 10:26
  • or for close from Jquery var mgObj=$('your-selecter').magnificPopup({ // you options }); // code to close pop up on clicking a button $(document).on('click','button',function(){ if(mgObj) { mgObj.close(); } }); – Jigs Virani Jul 15 '15 at 10:31