Merge branch 'feature/new-product-arrive' into gray
Showing
1 changed file
with
10 additions
and
8 deletions
@@ -228,24 +228,26 @@ $('#new-product-floor').on('click', '.catagory-navs li', function() { | @@ -228,24 +228,26 @@ $('#new-product-floor').on('click', '.catagory-navs li', function() { | ||
228 | */ | 228 | */ |
229 | $(function() { | 229 | $(function() { |
230 | // 轮播数量不够隐藏左右箭头 | 230 | // 轮播数量不够隐藏左右箭头 |
231 | - var $swiper = $('#rec-swiper, #brand-swiper'), | ||
232 | - recNum = $swiper.find('.swiper-wrapper > .swiper-slide').length, | ||
233 | - $prev = $swiper.find('.prev'), | ||
234 | - $next = $swiper.find('.next'); | 231 | + var $recSwiper = $('#rec-swiper'), |
232 | + $brandSwiper = $('#brand-swiper'), | ||
233 | + recNum = $recSwiper.find('.swiper-wrapper > .swiper-slide').length, | ||
234 | + brandNum = $brandSwiper.find('.swiper-wrapper > .swiper-slide').length; | ||
235 | 235 | ||
236 | if (recNum <= 6) { | 236 | if (recNum <= 6) { |
237 | - $prev.addClass('hide'); | ||
238 | - $next.addClass('hide'); | 237 | + $recSwiper.find('.prev,.next').addClass('hide'); |
238 | + } | ||
239 | + if (brandNum <= 6) { | ||
240 | + $brandSwiper.find('.prev,.next').addClass('hide'); | ||
239 | } | 241 | } |
240 | 242 | ||
241 | SwiperSingle.getSwiperWidth($('#rec-swiper'));//初始化宽度 | 243 | SwiperSingle.getSwiperWidth($('#rec-swiper'));//初始化宽度 |
242 | SwiperSingle.getSwiperWidth($('#brand-swiper'));//初始化宽度 | 244 | SwiperSingle.getSwiperWidth($('#brand-swiper'));//初始化宽度 |
243 | 245 | ||
244 | - $next.on('click', function () { | 246 | + $('.next').on('click', function () { |
245 | SwiperSingle.next($(this).parent()); | 247 | SwiperSingle.next($(this).parent()); |
246 | }); | 248 | }); |
247 | 249 | ||
248 | - $prev.on('click', function () { | 250 | + $('.prev').on('click', function () { |
249 | SwiperSingle.prev($(this).parent()); | 251 | SwiperSingle.prev($(this).parent()); |
250 | }); | 252 | }); |
251 | 253 |
-
Please register or login to post a comment