...
|
...
|
@@ -99,25 +99,25 @@ function bindAvatar(dom) { |
|
|
avatarKey = dom.index();
|
|
|
|
|
|
if (!dom.hasClass('swiper-slide-active')) {
|
|
|
if (avatarKey >= (2 * bannerLen + 1)) {
|
|
|
avatarSwiperClone && avatarSwiperClone.slideTo(bannerLen + 1, 0);
|
|
|
avatarSwiper.slideTo(bannerLen + 1, 0);
|
|
|
} else if (avatarKey <= (bannerLen - 1)) {
|
|
|
avatarSwiperClone && avatarSwiperClone.slideTo(2 * bannerLen - 1, 0);
|
|
|
avatarSwiper.slideTo(2 * bannerLen - (bannerLen - avatarKey), 0);
|
|
|
} else {
|
|
|
//if (avatarKey >= (2 * bannerLen + 1)) {
|
|
|
// avatarSwiperClone && avatarSwiperClone.slideTo(bannerLen + 1, 0);
|
|
|
// avatarSwiper.slideTo(bannerLen + 1, 0);
|
|
|
//} else if (avatarKey <= (bannerLen - 1)) {
|
|
|
// avatarSwiperClone && avatarSwiperClone.slideTo(2 * bannerLen - 1, 0);
|
|
|
// avatarSwiper.slideTo(2 * bannerLen - (bannerLen - avatarKey), 0);
|
|
|
//} else {
|
|
|
avatarSwiperClone && avatarSwiperClone.slideTo(avatarKey, 200);
|
|
|
avatarSwiper.slideTo(avatarKey, 200);
|
|
|
}
|
|
|
//}
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function setIndexAction() {
|
|
|
// $('.avatar').each(function(key, item) {
|
|
|
// $(item).addClass('avatar-' + key);
|
|
|
// });
|
|
|
$('.avatar').each(function(key, item) {
|
|
|
$(item).addClass('avatar-' + key);
|
|
|
});
|
|
|
|
|
|
// 明星头像 swiper 初始化
|
|
|
if (bannerLen > 1) {
|
...
|
...
|
@@ -125,7 +125,7 @@ function setIndexAction() { |
|
|
lazyLoading: true,
|
|
|
lazyLoadingInPrevNextAmount: 3,
|
|
|
|
|
|
// loop: true,
|
|
|
//loop: true,
|
|
|
initialSlide: 2,
|
|
|
centeredSlides: true,
|
|
|
slidesPerView: 'auto',
|
...
|
...
|
|