Authored by zhangxiaoru

轮播图

var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper');
Swiper = require('yoho-swiper2');
var bannerSwiper,
categoryHeight = $('.tab-box').height(),
... ... @@ -74,20 +74,39 @@ $('.brand-tab').find('li').click(function() {
$('.category-content').removeClass('hide').siblings().addClass('hide');
$('.cate-cha').removeClass('hide').siblings().addClass('hide');
}
$('.banner-swiper').each(function() {
if ($(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) {
new Swiper(this, {
preloadImages: false,
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingOnTransitionStart: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li'
});
}
});
});
$(function() {
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
autoplay: 2000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.banner-top .pagination-inner'
});
}
$('.banner-swiper').each(function() {
if ($(this).find('li').length > 1) {
new Swiper(this, {
preloadImages: false,
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingOnTransitionStart: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li'
});
}
});
});
... ...
... ... @@ -207,13 +207,13 @@
}
}
.swiper-pagination {
.pagination-inner {
left: auto;
right: 0.75rem;
-webkit-transform: none;
transform: none;
position: absolute;
bottom: 10px;
bottom: 5px;
right: 30px;
}
... ... @@ -240,6 +240,10 @@
border-radius: 100%;
}
}
.swiper-pagination {
bottom: 0;
}
}
.hide {
... ...