web/_javascript/utils/img-extra.js

29 lines
615 B
JavaScript
Raw Normal View History

2021-04-21 18:17:34 +03:00
/**
* Set up image stuff
2022-10-25 14:26:44 +03:00
*/
2021-04-21 18:17:34 +03:00
(function() {
if ($('#core-wrapper img[data-src]') <= 0) {
2022-10-25 14:26:44 +03:00
return;
}
2021-04-21 18:17:34 +03:00
/* See: <https://github.com/dimsemenov/Magnific-Popup> */
2022-10-25 14:26:44 +03:00
$('.popup').magnificPopup({
type: 'image',
closeOnContentClick: true,
showCloseBtn: false,
zoom: {
enabled: true,
duration: 300,
easing: 'ease-in-out'
}
});
2021-04-21 18:17:34 +03:00
/* Stop shimmer when image loaded */
document.addEventListener('lazyloaded', function(e) {
const $img = $(e.target);
$img.parent().removeClass('shimmer');
});
})();