Authored by 王水玲

星潮教室首页明星头像效果

... ... @@ -71,8 +71,6 @@ function setIndexAction() {
var $loadingTip = $('.loading-tip');
var $avatarWrap = $('.avatar-wrap');
var move;
// 下拉刷新,上拉加载
starIScroll = new PullRefresh('.star-wrap', {
height: $(window).height() - commonHeaderTop,
... ... @@ -109,7 +107,7 @@ function setIndexAction() {
slidesPerView: 'auto',
loopedSlides: bannerLen,
spaceBetween: 10,
slidesOffsetBefore : -($('.swiper-num').width()),
slidesOffsetBefore: -($('.swiper-num').width()),
watchSlidesProgress: true,
watchSlidesVisibility: true
});
... ... @@ -190,8 +188,8 @@ function setIndexAction() {
}
*/
$('.avatar').each(function(key, item){
$(item).addClass('avatar-' + key);
$('.avatar').each(function(key, item) {
$(item).addClass('avatar-' + key);
});
// banner swiper 初始化
... ... @@ -212,15 +210,14 @@ function setIndexAction() {
if (bannerLen > 1) {
avatarSwiper = new Swiper('.avatar-1', {
loop: true,
mode:'horizontal',
centeredSlides: true,
slidesPerView: 'auto',
loopedSlides: bannerLen,
spaceBetween: 10,
slidesOffsetBefore : -($('.swiper-num').width()),
slidesOffsetBefore: -($('.swiper-num').width()),
watchSlidesProgress: true,
watchSlidesVisibility: true
});
});
}
// 明星动态头像左右滑动
... ... @@ -250,7 +247,7 @@ function setIndexAction() {
} else {
avatarKey = $(this).index();
if(avatarSwiperClone) {
if (avatarSwiperClone) {
avatarSwiperClone.slideTo(avatarKey, 1000, false);
}
... ... @@ -288,7 +285,7 @@ getIndexHtml = function() {
$('.avatar-clone').remove();
}
$('.avatar li').each(function(){
$('.avatar li').each(function() {
setAvatar($(this).find('span'));
});
... ...