Fancybox breaks swiper. Adds offset without visible CSS and DOM changes. To replicate the issue on jsbin (https://output.jsbin.com/jiqucacete) you need:
new Swiper('.swiper-container', {
slidesPerView: 1
});
1) Press on the swiper slide image 2) Go to next image in fancybox gallery popup 3) Close gallery and there will be slide change in swiper
How does it work? Why there aren't visible any CSS, DOM changes? How to fix?
fancybox places focus back on the trigger element after closing the gallery and sometimes carousel/slider scripts are sensitive to this feature. To disable that, set backFocus:false
, for example:
$.fancybox.defaults.backFocus = false;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With