我正在使用swiper.js两侧都有导航按钮,当我按最后一张幻灯片的右按钮时,我想转到第一张幻灯片。如何编写条件语句?但是,将不使用循环功能。
var swiperSetting = {
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
renderBullet: function (index, className) {
return '<span class="' + className + '">' + ($('.swiper-slide:not(.swiper-slide-duplicate):eq('+index+')').data('name')) + '</span>';
}
},
observer:true,
touchStartPreventDefault: false,
// autoplay: {
// delay: 3000,
// disableOnInteraction: false
// },
navigation: {
nextEl: '.arrow-right',
prevEl: '.arrow-left',
},
}