I have coded a system which uses the Slick Slider plugin so that I can slide horizontally from one content to another (those slides are including both pictures and text). I also added Fancybox so that I can see the pictures in those slides in fullscreen If needed.
But those two plugins kind of conflict with each other.
Everything works but if I have more than one slide, the Fancybox gallery will show me several times the same picture (it behaves like a gallery of the same picture).
It's clearly a conflict as when I get rid of the slider js file, the Fancybox works again as it should (each picture is only showed once).
And when I keep both the galleries, the strangest thing is that the gallery behavior only occurs when I add sliders, even though they don't embed anything at all, no Fancybox, no pictures, no nothing.
Here below a jsfiddle link. My code is way more complicated of course but I made it as simple as it is possible to be for the test case. Almost no styling or js besides the plugins.
You'll see that if you get rid of everything inside the ".slider2" div, it will behave just fine. If not, the first picture will display a gallery of 2 identical pictures (instead of one and it will say by default that it is showing the picture 1 of 2) while the second image will display a gallery of 3 identical images (instead of one and it will say by default that it is showing the picture 2 of 3).
Thank you for your help.
<head>
<link rel="stylesheet" type="text/css" href="styles/jquery.fancybox.css" />
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/[email protected]/slick/slick.css"/>
<style>
img{width:50%;}
</style>
</head>
<body>
<div class="container">
<div class="slider_block">
<div class="slider1">
<a data-fancybox="test1" href="https://www.lexgotham.com/test/images/im1.jpg">
<img alt="" src="https://www.lexgotham.com/test/images/im1.jpg" />
</a>
</div>
<div class="slider2">
<a data-fancybox="test2" href="https://www.lexgotham.com/test/images/im2.jpg">
<img alt="" src="https://www.lexgotham.com/test/images/im2.jpg" />
</a>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js"></script>
<script>$(document).ready(function() {$('.sliding').slick({});});</script>
</body>