Showing
3 changed files
with
7 additions
and
4 deletions
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <ul class="clearfix swiper-wrapper"> | 12 | <ul class="clearfix swiper-wrapper"> |
13 | {{# starAvatar}} | 13 | {{# starAvatar}} |
14 | <li class="swiper-slide"> | 14 | <li class="swiper-slide"> |
15 | - <span class="rank-avatar" data-url="{{url}}" data-avatar="{{image cover 180 180}}"></span> | 15 | + <a class="rank-avatar" href='{{url}}' data-avatar="{{image cover 180 180}}"></a> |
16 | </li> | 16 | </li> |
17 | {{/ starAvatar}} | 17 | {{/ starAvatar}} |
18 | </ul> | 18 | </ul> |
@@ -245,9 +245,7 @@ function setIndexAction() { | @@ -245,9 +245,7 @@ function setIndexAction() { | ||
245 | 245 | ||
246 | // 明星头像点击居中显示或跳转 | 246 | // 明星头像点击居中显示或跳转 |
247 | $('.avatar-swiper li').on('click', function() { | 247 | $('.avatar-swiper li').on('click', function() { |
248 | - if ($(this).hasClass('swiper-slide-active')) { | ||
249 | - location.href = $(this).find('span').data('url'); | ||
250 | - } else { | 248 | + if (!$(this).hasClass('swiper-slide-active')) { |
251 | avatarKey = $(this).index(); | 249 | avatarKey = $(this).index(); |
252 | 250 | ||
253 | if (avatarKey >= (2 * bannerLen + 1)) { | 251 | if (avatarKey >= (2 * bannerLen + 1)) { |
@@ -260,6 +258,8 @@ function setIndexAction() { | @@ -260,6 +258,8 @@ function setIndexAction() { | ||
260 | avatarSwiperClone && avatarSwiperClone.slideTo(avatarKey, 0); | 258 | avatarSwiperClone && avatarSwiperClone.slideTo(avatarKey, 0); |
261 | avatarSwiper.slideTo(avatarKey, 0); | 259 | avatarSwiper.slideTo(avatarKey, 0); |
262 | } | 260 | } |
261 | + | ||
262 | + return false; | ||
263 | } | 263 | } |
264 | }); | 264 | }); |
265 | 265 |
@@ -361,6 +361,9 @@ | @@ -361,6 +361,9 @@ | ||
361 | } | 361 | } |
362 | 362 | ||
363 | .rank-avatar { | 363 | .rank-avatar { |
364 | + display: block; | ||
365 | + width: 100%; | ||
366 | + height: 100%; | ||
364 | background-image: resolve("guang/star/user-avatar.png"); | 367 | background-image: resolve("guang/star/user-avatar.png"); |
365 | background-repeat: no-repeat; | 368 | background-repeat: no-repeat; |
366 | background-size: contain; | 369 | background-size: contain; |
-
Please register or login to post a comment