jQuery(function($){ 'use strict'; $('.fetish-gallery').magnificPopup({ delegate: 'a', type: 'image', tLoading: 'Loading image #%curr%...', mainClass: 'mfp-img-mobile', gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] }, removalDelay: 500, callbacks: { beforeOpen: function () { this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); this.st.mainClass = this.st.el.attr('data-effect'); } }, image: { tError: 'The image #%curr% could not be loaded.', titleSrc: function(item) { return item.el.attr('title') + ''; } } }); });