<script src="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/js/splide.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/css/splide.min.css"
/>
document.addEventListener( 'DOMContentLoaded', function () {
new Splide( '#image-slider' ).mount();
} );
.splide__slide img {
width : 100%;
height: auto;
}
using 'cover' option, images can be displayed in a same size
document.addEventListener( 'DOMContentLoaded', function () {
new Splide( '#image-slider', {
'cover' : true,
'heightRatio': 0.5,
} ).mount();
} );
breakpoints: {
600: {
perPage: 1,
}
document.addEventListener( 'DOMContentLoaded', function () {
new Splide( '#fullscreen-slider', {
width : '100vw',
height: '100vh',
} ).mount();
} );