Authored by ccbikai

sale 页面单张swiper不初始化

... ... @@ -16,10 +16,13 @@ var index = 0,
page = 0,
pd = "";
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
pagination: '.swiper-pagination'
});
// slide 个数大于 1 时,使用 swiper ,否则只显示单张图片
if ($('.swiper-container .swiper-slide').length > 1) {
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
pagination: '.swiper-pagination'
});
}
lazyLoad($('img.lazy'));
$curNav = $navList.children('.focus');
... ...
... ... @@ -18,7 +18,7 @@ var winH = $(window).height(),
var swiper;
// slide 个数大于 1 时,使用 swiper ,否则只显示单张图片
if ($('.swiper-container').length > 1) {
if ($('.swiper-container .swiper-slide').length > 1) {
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
pagination: '.swiper-pagination'
... ...