var mySwiper=$(".swiper-container").swiper({
autoHeight: true,
onSlideChangeStart: function() {
var H = $(".swiper-slide").eq(mySwiper.activeIndex).find(".bigbox").height();
var scH=$(".swiper-container").height();
var bodyH=$("body").height()
if(H<scH){
console.log(scH)
alert($("body").height())
$(".swiper-slide").css(‘height‘, bodyH-20 + ‘px‘);
$(".swiper-wrapper").css(‘height‘, bodyH-20 + ‘px‘);
}else{
$(".swiper-slide").css(‘height‘, H + ‘px‘);
$(".swiper-wrapper").css(‘height‘, H + ‘px‘);
}
console.log("slideH:" + $(".swiper-slide").height())
console.log("wrapperH:" + $(".swiper-wrapper").height())
}
本文出自 “11112450” 博客,转载请与作者联系!
原文地址:http://11122450.blog.51cto.com/11112450/1965651