Skip to content

Instantly share code, notes, and snippets.

@bepatrickdavid
Created October 13, 2015 08:47
Show Gist options
  • Save bepatrickdavid/897a7b03ed1e961182d3 to your computer and use it in GitHub Desktop.
Save bepatrickdavid/897a7b03ed1e961182d3 to your computer and use it in GitHub Desktop.
Magnific Popup: img link and a link
$('.one-slide').each(function() { // the containers for all your galleries
$(this).magnificPopup({
delegate: 'a', // the selector for gallery item
type: 'image',
gallery: {
enabled:true
}
});
});
$(document).ready(function() {
$('#single-post .content .gallery-item').each(function() { // the containers for all your galleries
$(this).magnificPopup({
delegate: 'img', // the selector for gallery item
type: 'image',
gallery: {
enabled:true
},
callbacks: {
elementParse: function(item) { item.src = item.el.attr('src'); }
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment