Authored by 王水玲

星潮教室

@@ -46,9 +46,9 @@ function scrollHandler() { @@ -46,9 +46,9 @@ function scrollHandler() {
46 } 46 }
47 47
48 // 分享成功 48 // 分享成功
49 -function successShare() {  
50 - tip.show('分享成功,亲密度+10');  
51 -} 49 +// function successShare() {
  50 +// tip.show('分享成功,亲密度+10');
  51 +// }
52 52
53 $(window).scroll(function() { 53 $(window).scroll(function() {
54 scrollHandler(); 54 scrollHandler();
@@ -70,38 +70,8 @@ function bytesCountAction(code, bytesCount) { @@ -70,38 +70,8 @@ function bytesCountAction(code, bytesCount) {
70 return bytesCount; 70 return bytesCount;
71 } 71 }
72 72
73 -if ($('.banner-swiper').find('li').length > 1) {  
74 - bannerSwiper = new Swiper('.banner-swiper', {  
75 - lazyLoading: true,  
76 - lazyLoadingInPrevNext: true,  
77 - loop: true,  
78 - autoplay: 3000,  
79 - autoplayDisableOnInteraction: false,  
80 - paginationClickable: true,  
81 - slideElement: 'li',  
82 - pagination: '.banner-top .pagination-inner'  
83 - });  
84 -}  
85 -  
86 -if ($('.collocation-swiper').find('li').length > 1) {  
87 - collocationSwiper = new Swiper('.collocation-swiper', {  
88 - lazyLoading: true,  
89 - lazyLoadingInPrevNext: true,  
90 - lazyLoadingOnTransitionStart: true,  
91 - grabCursor: true,  
92 - slidesPerView: 'auto',  
93 - slideElement: 'li',  
94 - watchSlidesVisibility: true  
95 - });  
96 -}  
97 -  
98 -// 星鲜事显示点赞人数的区域  
99 -if ($('.artice-zan').find('li').length > 0) {  
100 - $('.zan-more').show();  
101 -}  
102 -  
103 // 亲密度用户名字字数限制 73 // 亲密度用户名字字数限制
104 -if ($('.home-floor-sign').length > 0) { 74 +function limitUsername() {
105 var $name = $('.home-floor-sign').find('.user-name'), 75 var $name = $('.home-floor-sign').find('.user-name'),
106 nameVal = $name.html(), 76 nameVal = $name.html(),
107 nameSize = nameVal.length, 77 nameSize = nameVal.length,
@@ -121,7 +91,7 @@ if ($('.home-floor-sign').length > 0) { @@ -121,7 +91,7 @@ if ($('.home-floor-sign').length > 0) {
121 } 91 }
122 92
123 if (bytesCount > 8) { 93 if (bytesCount > 8) {
124 - newName += '..' 94 + newName += '..';
125 } 95 }
126 96
127 for (i = 0; i < nameSize; i++) { 97 for (i = 0; i < nameSize; i++) {
@@ -136,6 +106,40 @@ if ($('.home-floor-sign').length > 0) { @@ -136,6 +106,40 @@ if ($('.home-floor-sign').length > 0) {
136 $name.html(newName); 106 $name.html(newName);
137 } 107 }
138 108
  109 +if ($('.banner-swiper').find('li').length > 1) {
  110 + bannerSwiper = new Swiper('.banner-swiper', {
  111 + lazyLoading: true,
  112 + lazyLoadingInPrevNext: true,
  113 + loop: true,
  114 + autoplay: 3000,
  115 + autoplayDisableOnInteraction: false,
  116 + paginationClickable: true,
  117 + slideElement: 'li',
  118 + pagination: '.banner-top .pagination-inner'
  119 + });
  120 +}
  121 +
  122 +if ($('.collocation-swiper').find('li').length > 1) {
  123 + collocationSwiper = new Swiper('.collocation-swiper', {
  124 + lazyLoading: true,
  125 + lazyLoadingInPrevNext: true,
  126 + lazyLoadingOnTransitionStart: true,
  127 + grabCursor: true,
  128 + slidesPerView: 'auto',
  129 + slideElement: 'li',
  130 + watchSlidesVisibility: true
  131 + });
  132 +}
  133 +
  134 +// 星鲜事显示点赞人数的区域
  135 +if ($('.artice-zan').find('li').length > 0) {
  136 + $('.zan-more').show();
  137 +}
  138 +
  139 +if ($('.home-floor-sign').length > 0) {
  140 + limitUsername();
  141 +}
  142 +
139 // 星鲜事点赞事件 143 // 星鲜事点赞事件
140 $('.like-ico').on('click', function() { 144 $('.like-ico').on('click', function() {
141 var $that = $(this), 145 var $that = $(this),