Skip to content

Instantly share code, notes, and snippets.

@Papapashu
Created June 11, 2015 06:49
Show Gist options
  • Save Papapashu/61bb89890cbe631d3a66 to your computer and use it in GitHub Desktop.
Save Papapashu/61bb89890cbe631d3a66 to your computer and use it in GitHub Desktop.
magnificPopup init
$('.zoom-gallery').magnificPopup({
delegate: 'a',
type: 'image',
closeOnContentClick: false,
closeBtnInside: true,
mainClass: 'mfp-with-zoom mfp-img-mobile',
image: {
verticalFit: true,
titleSrc: function(item) {
return item.el.attr('title') + ' &middot; <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>';
}
},
gallery: {
enabled: true
},
zoom: {
enabled: true,
duration: 500, // don't foget to change the duration also in CSS
opener: function(element) {
return element.find('img');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment