Showing
1 changed file
with
57 additions
and
0 deletions
@@ -247,6 +247,63 @@ define('channel', function(require, exports) { | @@ -247,6 +247,63 @@ define('channel', function(require, exports) { | ||
247 | cooperateNext, | 247 | cooperateNext, |
248 | swiperLen, | 248 | swiperLen, |
249 | changeCooperationClass; | 249 | changeCooperationClass; |
250 | + var cooperateSwiper, | ||
251 | + bannerSwipe; | ||
252 | + //大banner滑动 | ||
253 | + if ($('.slide-main').find('.box').size() > 1) { | ||
254 | + bannerSwipe = swipe.init({ | ||
255 | + slideBox: '.slide-box', | ||
256 | + prev: '.slide-prev', | ||
257 | + next: '.slide-next', | ||
258 | + auto: 3000, | ||
259 | + continuous: true, | ||
260 | + callback: function(index) { | ||
261 | + if (index >= $('.dib a').size()) { | ||
262 | + index = index - $('.dib a').size(); | ||
263 | + } | ||
264 | + $('.dib a').removeClass('on').eq(index).addClass('on'); | ||
265 | + } | ||
266 | + }); | ||
267 | + } | ||
268 | + | ||
269 | + $('.dib').on('click', 'a', function() { | ||
270 | + bannerSwipe.slide($(this).index()); | ||
271 | + }) | ||
272 | + | ||
273 | + if ($('.slide-box').find('.box').size() <= 1) { | ||
274 | + $('.slide-navigator').hide(); | ||
275 | + $('.slide-control').hide(); | ||
276 | + } | ||
277 | + | ||
278 | + $('.cooperation-slide-prev').addClass('disable'); | ||
279 | + cooperateSwiper = new swiper('.cooperation-slide-box', { | ||
280 | + wrapperClass: 'slide-wrap', | ||
281 | + slideClass: 'box', | ||
282 | + slidesPerView: 'auto', | ||
283 | + onSlideChangeStart: function() { | ||
284 | + var swiperLen = $('.cooperation-slide-box').find('.box').size(); | ||
285 | + $('.cooperation-slide-prev,.cooperation-slide-next').removeClass('disable'); | ||
286 | + if (cooperateSwiper.activeIndex === swiperLen - 1) { | ||
287 | + $('.cooperation-slide-next').addClass('disable'); | ||
288 | + } else if (cooperateSwiper.activeIndex === 0) { | ||
289 | + $('.cooperation-slide-prev').addClass('disable'); | ||
290 | + } | ||
291 | + } | ||
292 | + }); | ||
293 | + | ||
294 | + $('.cooperation-slide-prev').on('click', function(e) { | ||
295 | + e.preventDefault(); | ||
296 | + cooperateSwiper.swipePrev(); | ||
297 | + }); | ||
298 | + $('.cooperation-slide-next').on('click', function(e) { | ||
299 | + e.preventDefault(); | ||
300 | + cooperateSwiper.swipeNext(); | ||
301 | + }); | ||
302 | + if (parseInt($("#right_banner").attr("num")) > 0) { | ||
303 | + $("#img_flow").find(".layout-item").eq(2).before($("#right_banner").html()); | ||
304 | + } | ||
305 | + setFlowLayout(); | ||
306 | + | ||
250 | 307 | ||
251 | /** | 308 | /** |
252 | * 将 资讯页面的 固定 banner 位插入资讯右侧 | 309 | * 将 资讯页面的 固定 banner 位插入资讯右侧 |
-
Please register or login to post a comment