dimsemenov / Magnific-Popup

Light and responsive lightbox script with focus on performance.
http://dimsemenov.com/plugins/magnific-popup/
MIT License
11.38k stars 3.49k forks source link

closeMarkup not working in Google Chrome browser #535

Open ghost opened 10 years ago

ghost commented 10 years ago

Hi,

I am initialising with:

$('.test-popup-link').magnificPopup({ type: 'image', closeMarkup: '' });

which adds a close gif image on the top right. When clicked on the close image in Firefox 31, it closes the image as expected. However, in Google Chrome 37, the close gif appears, but clicking on it doesn't do anything.

CalebKester commented 10 years ago

It looks to be something with the event propagation with the .mfp-close class. I'm using this temporary event to provide an additional call to close it

        // Temp fix for magnific popup close issue
        $(document).on('click', '.mfp-close', function (e) {
            e.preventDefault();
            $.magnificPopup.close();
        });
ghost commented 10 years ago

Hi,

Now working :)

Many thanks.

floriancapelle commented 9 years ago

I experience the same issue with custom close markup. +1 The solution is hacky to me, but for now it seems like a proper workaround.