var mainSwiper = new Swiper(".swiper-container-v", {
direction: "vertical",
kyboard: true,
pagination: {
el: ".swiper-pagination-v",
clickable: true
},
mousewheel: true,
slideToClickedSlide:true,
});
var swiperH = new Swiper(".swiper-container-h", {
spaceBetween: 50,
pagination: {
el: ".swiper-pagination-h",
clickable: true
},
loop: true,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
CodePen - Vsite Test2018
我希望示例中的滑块自动播放。
var mainSwiper = new Swiper(".swiper-container-v", {
direction: "vertical",
kyboard: true,
pagination: {
el: ".swiper-pagination-v",
clickable: true
},
mousewheel: true,
slideToClickedSlide:true,
});
我想在示例代码中添加自动播放功能。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这非常简单,您只需在代码中添加自动播放属性即可。请检查此代码。希望您能得到答案
var swiper = new Swiper('.swiper-5', { navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, loop: true, autoplay: { delay: 3000, disableOnInteraction: true, }, });