I have an issue here and would love your input. So, I have a page with 3 images side by side in desktop mode and landscape mode, and they need to turn into a slider on mobile, portrait. I used slick slider, the code below, added the newest jQuery link and worked just fine - they were all added in the same file, to test them: html, jquery cdn, jquery code. However, we are using a CMS, so when I moved the js code to a .js file and the jquery v3.5.1 loaded externally, it stopped working for iOS. Did you encounter a similar situation? Any ideas? Thanks!
$slickTest = false;
function startSlider() {
if ($(window).width() <= 540) {
if (!$slickTest) {
$(".responsive").slick({
dots: true,
arrows: false,
slidesToShow: 1,
slidesToScroll: 1,
infinite: true
});
$slickTest = true;
}
} else if ($(window).width() > 540) {
if ($slickTest) {
$('.responsive').slick('unslick');
$slickTest = false;
}
}
}
$(document).ready(function() {
startSlider();
});
$(window).on('resize', function() {
startSlider();
});
});