我的代码就像这里
最佳答案
更新:
正如在较新版本的评论中提到的passatgt,computeHeight被替换为autoHeight,here你可以找到一个例子:
var swiper = new Swiper('.swiper-container',{
autoHeight: true,//enable auto height
spaceBetween: 20,pagination: {
el: '.swiper-pagination',clickable: true,},navigation: {
nextEl: '.swiper-button-next',prevEl: '.swiper-button-prev',});
将calculateHeight:true添加到swiper定义.
var tabsSwiper = new Swiper('.swiper-container',{
speed:300,calculateHeight:true,onSlideChangeStart: function(){
$(".tabs li").removeClass('active')
$(".tabs li").eq(tabsSwiper.activeIndex).addClass('active')
}
})