I'm using the latest version of Splide (3.6.12 as of Today) via their CDN.
I have multiple sliders on my page, and Splide is working perfectly well on desktop. Responsive mode in Chrome works well too, in any size. However, when I'm loading the same page using a real mobile device, whether I'm using Chrome or Safari, all the sliders are hidden. I have a default configuration, no plugins, and I've tried on multiple devices.
I've checked the console on the mobile device in Chrome, and did not see any warning or error message. I've also already checked for any specific CSS styles that would cause that.
If I remove Splide's container from the HTML code, images appear again on mobile.
I tried to reproduce the issue using Codepen, but the example below actually works on mobile!
https://codepen.io/bruno-l-v-que/pen/vYWRbvz
<div class="splide">
<div class="splide__track">
<ul class="splide__list">
<li class="splide__slide"><img src="https://picsum.photos/seed/picsum/250/250" /></li>
<li class="splide__slide"><img src="https://picsum.photos/seed/picsum/250/250" /></li>
<li class="splide__slide"><img src="https://picsum.photos/seed/picsum/250/250" /></li>
</ul>
</div>
</div>
<div class="splide">
<div class="splide__track">
<ul class="splide__list">
<li class="splide__slide"><img src="https://picsum.photos/seed/picsum/250/250" /></li>
<li class="splide__slide"><img src="https://picsum.photos/seed/picsum/250/250" /></li>
<li class="splide__slide"><img src="https://picsum.photos/seed/picsum/250/250" /></li>
</ul>
</div>
</div>
<style>
body { background: black; }
div.splide { width: 250px; height: 250px; margin-bottom: 25px; }
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
var elms = document.getElementsByClassName('splide');
for (var i = 0; i < elms.length; i++)
new Splide(elms[i]).mount();
});
</script>
Are there any specifics or known issues with Splide on mobile devices?
Made an account to give a potential solution, I encountered this while making a site through Webflow.
The fix was to ensure lazy loading wasn't enabled for the images used, the component can't seem to work with lazy loading for some reason.
Let me know if that works!