Skip to content

Instantly share code, notes, and snippets.

@rmcgrew
Created February 1, 2022 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmcgrew/857bd7f87d6508a4e04f09c933fca6b1 to your computer and use it in GitHub Desktop.
Save rmcgrew/857bd7f87d6508a4e04f09c933fca6b1 to your computer and use it in GitHub Desktop.
$(".article__body img").magnificPopup({
type: "image",
callbacks: {
elementParse: function(item) {
item.src = item.el.context.src;
}
},
closeOnContentClick: true,
closeBtnInside: false,
fixedContentPos: true,
mainClass: "mfp-with-zoom", // class to remove default margin from left and right side
image: {
verticalFit: true
},
zoom: {
enabled: true,
duration: 300 // don't foget to change the duration also in CSS
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment