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

gallery group problem #714

Open DjSunrise opened 9 years ago

DjSunrise commented 9 years ago

here is web site http://vsedarom.kz/bolgartravel/ . Go to block MAJESTIC SEA VILLAGE and click on the photo. It's duplicates photo. How can I fix it?

// Allow opening images var groups = {}; $('.magnificImage').each(function() { var id = parseInt($(this).attr('data-group'), 30);

if(!groups[id]) { groups[id] = []; }

groups[id].push( this ); });

$.each(groups, function() {

$(this).magnificPopup({ type: 'image', mainClass: 'mfp-zoom-in', tLoading: '', gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, removalDelay: 500, //delay removal by X to allow out-animation callbacks: {

imageLoadComplete: function() { var self = this; setTimeout(function() { self.wrap.addClass('mfp-image-loaded'); }, 16); }, close: function() { this.wrap.removeClass('mfp-image-loaded'); },

// don't add this part, it's just to avoid caching of image beforeChange: function() { this.items[0].src = this.items[0].src + '?=' + Math.random(); } },

closeBtnInside: false, closeOnContentClick: true, midClick: true })

});

hchor commented 9 years ago

Why are you loading both magnific and slickslider? I wonder if that's causing a problem? Did you try disabling slickslider for .firstslider?