swiper轮播箭头垂直居中
取消懒加载
for (var i in $('.p01-s9 .lazyload')) {
$('.p01-s9 .lazyload').eq(i).attr('src',$('.p01-s9 .lazyload').eq(i).attr('data-src'));
}
$('.p01-s9 .lazyload').removeClass('lazyload').addClass('lazyloaded');
//轮播箭头垂直居中
function reactiveGallaryArrowTop($swiper) {
var outerHeight = $($swiper).find(".swiper-wrapper").height();
var imgHeight = $($swiper).find(".swiper-slide").find("img").height();
var percentage = 0.5*imgHeight/outerHeight * 100;
var prevArrow = $($swiper).find(".prev");
var nextArrow = $($swiper).find(".next");
prevArrow.css({
"top": percentage + '%'
});
nextArrow.css({
"top": percentage + '%'
});
}
//swiper调用
on: {
imagesReady: function(){
reactiveGallaryArrowTop('#p01-s5');
}
}