Last active
June 28, 2017 03:18
-
-
Save nacm/459420ef88194fbbfeb7201ca8aae6cf to your computer and use it in GitHub Desktop.
fixing multiple gallery issue with magnific-popup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When using magnificPopup plugin you might get multiple galleries combined. | |
// To fix this, use .each() function. | |
$('.slides').each(function() { // the containers for all your galleries | |
$(this).magnificPopup({ | |
delegate: 'a', // the selector for gallery item | |
type: 'image', | |
gallery: { | |
enabled:true, | |
}, | |
// other settings | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment