$(document).ready(function() { var swiperFlag = false; $(".banner li").eq(0).addClass("ani-slide"); if($(".banner li").length>1){ var mySwiper = new Swiper('.banner .swiper-container', { autoplay: 5000, speed:1000, autoHeight: true, loop: true, prevButton:'.banner .swiper-button-prev', nextButton:'.banner .swiper-button-next', autoplayDisableOnInteraction : false, pagination: '.banner .swiper-pagination', paginationClickable :true, onInit: function(swiper){ slide=swiper.slides.eq(0); slide.addClass('ani-slide'); },onTransitionStart: function(swiper){ for(i=0;i767) { if($(".banner li").length>1){ videoSelect($('.banner .swiper-slide.swiper-slide-active')); }else{ videoSelect02($('.banner .swiper-slide.swiper-slide-active')); } }else{ } function videoSelect(_this) { var flag = true; var cc = _this.hasClass('ban_video'); if(cc) { mySwiper.stopAutoplay(); var videos = ''; _this.append(videos); var aaa = setInterval(function() { if(!isNaN($(".vv").get(0).duration) && flag) { clearInterval(aaa); flag = false; setTimeout(function() { _this.find('video').css("display", "block"); }, 500) } }, 10); _this.find('video').bind('ended', function() { mySwiper.slideNext(); mySwiper.startAutoplay(); }); } else { $('.vv').remove(); } } function videoSelect02(_this) { var flag = true; var cc = _this.hasClass('ban_video'); if(cc) { mySwiper.stopAutoplay(); var videos = ''; _this.append(videos); var aaa = setInterval(function() { if(!isNaN($(".vv").get(0).duration) && flag) { clearInterval(aaa); flag = false; setTimeout(function() { _this.find('video').css("display", "block"); }, 500) } }, 10); _this.find('video').bind('ended', function() { mySwiper.slideNext(); mySwiper.startAutoplay(); }); } else { $('.vv').remove(); } } if($(".banner li").length>1){ $(".banner .but").show(); }else{ $(".banner .but").hide(); } }) $(function(){ indexslider(); indexabout(); }) function indexslider(){ if($(".index_slider li").length>1){ var brand3Swiper = new Swiper('.index_slider .swiper-container', { slidesPerView: 1, slidesPerGroup: 1, spaceBetween:0, speed:1000, loop: true, autoplayDisableOnInteraction : false, pagination: '.index_slider .swiper-pagination', paginationClickable :true, }) } } function indexabout(){ if($(".index_about li").length>1){ if($(window).width()>1190){ $(".index_about li").eq(0).addClass("on"); $(".index_about dt").hover(function(){ $(this).parents("li").addClass("on").siblings().removeClass("on"); var numindex=$(this).parents("li").index() $(".index_bg li").eq(numindex).addClass("on").siblings().removeClass("on"); }) // var brand3Swiper = new Swiper('.index_about .swiper-container', { // slidesPerView: "auto", // slidesPerGroup: 1, // spaceBetween:0, // speed:1000, // loop: true, // noSwiping : true, // autoplayDisableOnInteraction : false, // paginationClickable :true, // prevButton:'.index_about .swiper-button-prev', // nextButton:'.index_about .swiper-button-next', // onInit: function(swiper){ // slide=swiper.slides.eq(0); // slide.addClass('ani-slide'); // var num=$(".index_about li.swiper-slide-active").attr("data-swiper-slide-index"); // // console.log(num) // $(".index_bg li").eq(num).addClass("on").siblings().removeClass("on"); // },onTransitionStart: function(swiper){ // for(i=0;i