I’m using splide on my webflow site to create a services slider. on desktop it works great and in the mobile preview on desktop, it also works. the problem starts when i try and view it on my phone, the content on each slide glitches in and out during each transition. I had the whole section that holds the splide slider set to overflow:hidden so it doesnt get the horizontal scroll bar, when i turned that off, it was working normally on mobile again.
this is my webflow link: https://platinum-medical.webflow.io
I tried making the whole body overflow:hidden but that still broke it, i also tried setting the splide__track to a specific width but i still get the horizontal scroll issue.
here is my code (CSS & JS):
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/css/splide-core.min.css">
<style>
.splide__track {
overflow: visible;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/js/splide.min.js"></script>
<script>
function slider1() {
let splides = $('.slider_model');
for ( let i = 0, splideLength = splides.length; i < splideLength; i++ ) {
new Splide( splides[ i ], {
// Desktop on down
autoplay: true,
interval: 3000,
perPage: 3,
perMove: 1,
focus: 'center', // 0 = left and 'center' = center
type: 'loop', // 'loop' or 'slide'
gap: '.5em', // space between slides
arrows: 'false', // 'slider' or false
pagination: 'false', // 'slider' or false
speed : 1000, // transition speed in miliseconds
dragAngleThreshold: 30, // default is 30
autoWidth: false, // for cards with differing widths
rewind : false, // go back to beginning when reach end
rewindSpeed : 400,
waitForTransition : true,
updateOnMove : true,
trimSpace: false, // true removes empty space from end of list
breakpoints: {
991: {
perPage: 2,
// Tablet
},
767: {
// Mobile Landscape
perPage: 2,
},
479: {
// Mobile Portrait
perPage: 1,
}
}
} ).mount();
}
}
slider1();
</script>
This is the animation css for the active slide
<style>
.splide__slide.is-active .service_slider-content{
opacity: 100%;
transform: translate(0%);
}
.splide__slide.is-active .slider_mood{
transform:scale(1);
}
</style>
What I would like my site to look like, without the horizontal scrolling
screen recording of the glitch on my phone -> https://drive.google.com/file/d/1Gr0oznD2Q6qs3X1cblGvKSVnPAuVPKkK/view?usp=sharing
I swear i googled and searched the splide docs before making this post, please, if the answer was obvious i would love to be humbled :’)