By clicking on the button .zoom-link "magnific" is triggered, but then it closes.
`
$(document).on('click', '.zoom-link', function() { $('#gallery').magnificPopup({ delegate: 'a', type: 'image', closeOnContentClick: true, closeBtnInside: true, mainClass: 'mfp-with-zoom mfp-img-mobile', gallery: { enabled: true }, zoom: { enabled: true, duration: 300, opener: function(element) { return element.find('img'); } } }).magnificPopup('open'); }); <div id="gallery"> <a href="img/portfolio/Layer31.jpg" class="gallery-item mobile"> <img src="img/portfolio/Layer31.jpg" alt=""> <div class="gallery-item__hover"> <div class="get-link"></div> <div class="zoom-link"></div> </div> </a> ...... </div> Tell me what's the problem?