...
|
...
|
@@ -191,7 +191,7 @@ getIndexHtml = function() { |
|
|
if (data) {
|
|
|
if (avatarSwiperClone) {
|
|
|
avatarSwiperClone.destroy(true, true);
|
|
|
avatarSwiperClone = '';
|
|
|
avatarSwiperClone = null;
|
|
|
}
|
|
|
|
|
|
$mainContent.html(data);
|
...
|
...
|
@@ -227,46 +227,44 @@ starIScroll.iScroll.on('scrollStart', function() { |
|
|
});
|
|
|
|
|
|
starIScroll.iScroll.on('scroll', function() {
|
|
|
var avatarOffsetT;
|
|
|
|
|
|
if (this.directionY !== -1) {
|
|
|
setTimeout(function() {
|
|
|
starIScroll.iScroll.refresh();
|
|
|
}, 0);
|
|
|
}
|
|
|
|
|
|
console.log(this);
|
|
|
|
|
|
$window.trigger('scroll');
|
|
|
avatarOffsetT = $avatarWrap[0].offsetTop;
|
|
|
|
|
|
if (-this.y >= avatarOffsetT) {
|
|
|
$avatarClone.show();
|
|
|
|
|
|
if (!avatarSwiperClone) {
|
|
|
avatarSwiperClone = new Swiper($avatarClone[0], {
|
|
|
loop: true,
|
|
|
initialSlide: $avatarWrap.find('.swiper-slide-active').index() % bannerLen,
|
|
|
centeredSlides: true,
|
|
|
slidesPerView: 'auto',
|
|
|
loopedSlides: bannerLen,
|
|
|
spaceBetween: 10,
|
|
|
slidesOffsetBefore: -swiperNum,
|
|
|
watchSlidesProgress: true,
|
|
|
watchSlidesVisibility: true,
|
|
|
onInit: function() {
|
|
|
$avatarClone.find('li').on('click', function() {
|
|
|
res = bindAvatar($(this));
|
|
|
return res;
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// if ($avatarWrap.offset().top <= headTabH) {
|
|
|
// $avatarClone.show();
|
|
|
//
|
|
|
// if (!avatarSwiperClone) {
|
|
|
// avatarSwiperClone = new Swiper('.avatar-0', {
|
|
|
// loop: true,
|
|
|
// initialSlide: $('.avatar-1').find('.swiper-slide-active').index() % bannerLen,
|
|
|
// centeredSlides: true,
|
|
|
// slidesPerView: 'auto',
|
|
|
// loopedSlides: bannerLen,
|
|
|
// spaceBetween: 10,
|
|
|
// slidesOffsetBefore: -swiperNum,
|
|
|
// watchSlidesProgress: true,
|
|
|
// watchSlidesVisibility: true,
|
|
|
// onInit: function() {
|
|
|
// $('.avatar-0 li').on('click', function() {
|
|
|
// res = bindAvatar($(this));
|
|
|
// return res;
|
|
|
// });
|
|
|
// }
|
|
|
// });
|
|
|
//
|
|
|
// avatarSwiperClone.params.control = avatarSwiper;
|
|
|
// avatarSwiper.params.control = avatarSwiperClone;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// if ($avatarWrap.offset().top > $('.avatar-1')[0].scrollHeight) {
|
|
|
// $avatarClone.hide();
|
|
|
// }
|
|
|
avatarSwiperClone.params.control = avatarSwiper;
|
|
|
avatarSwiper.params.control = avatarSwiperClone;
|
|
|
}
|
|
|
} else {
|
|
|
$avatarClone.hide();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
starIScroll.iScroll.on('scrollEnd', function() {
|
...
|
...
|
|