$(document).ready(function() { if($(".countUp").length>0){ $(".countUp").countUp(); } //ScollText(".history_list .c"); wowDelay(".announce-list ul",$('.announce-list ul li').length,"0.2"); wowDelay(".news-part01 ul",$('.news-part01 ul li').length,"0.2"); wowDelay(".news-part03 ul",$('.news-part03 ul li').length,"0.2"); wowDelay(".media-list ul",$('.media-list ul li').length,"0.2"); newsTop(); brand02(); brand03(); }) function newsTop(){ var news_top = new Swiper('.news_top_swiper .swiper-container', { //effect : 'fade', spaceBetween: 10, resistance : true, resistanceRatio : 0, observer:true, observeParents:true, //prevButton: '.news_top_swiper .swiper-button-prev', //nextButton: '.news_top_swiper .swiper-button-next', pagination : '.news_top_swiper .swiper-pagination', paginationClickable :true, onInit: function (swiper) { $(".news_right_current").html(swiper.realIndex + 1); $(".news_right_totle").html(swiper.slides.length); }, onSlideChangeStart: function (swiper) { $(".news_right_current").html(swiper.realIndex + 1); } }); } function brand02(){ var _ind = 0; var _len = $(".his_year .swiper-slide").length; var his_year_swiper = new Swiper('.brand_sw .swiper-container', { nextButton: '.brand_sw .swiper-button-next', prevButton: '.brand_sw .swiper-button-prev', slidesPerView:5, //initialSlide :$(".brand_sw .brand_sw .swiper-slide").length,//设定初始化时slide的索引。 breakpoints: { 767: { slidesPerView: 3, } } }); var his_sw_swiper = new Swiper('.his_sw .swiper-container', { nextButton: '.his_sw .swiper-button-next', prevButton: '.his_sw .swiper-button-prev', slidesPerView:5, breakpoints: { 767: { slidesPerView: 3, } } }); btnJudge(); $(".his_year .swiper-button-prev").click(function() { _ind--; btnJudge() $(".his_year .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".his_year .swiper-slide.on").click(); }) $('.his_year .swiper-button-next').click(function() { _ind++; btnJudge() $(".his_year .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".his_year .swiper-slide.on").click(); }) $(".his_year .swiper-slide").click(function(){ _ind = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); btnJudge(); var url = $(this).data("src"); if(url == ""){ return false; }else{ caseAjax(".history_cons",url) } }) $(".his_year .swiper-slide").eq(0).click(); function btnJudge() { //console.log(_ind,_len) if(_ind >= _len - 1) { $('.his_year .swiper-button-next').addClass("disabled") _ind = _len - 1; } else { $('.his_year .swiper-button-next').removeClass("disabled") } if(_ind <= 0) { $(".his_year .swiper-button-prev").addClass("disabled") _ind = 0; } else { $(".his_year .swiper-button-prev").removeClass("disabled") } } } function brand03(){ var brand03swiper = new Swiper('.brand03-swiper .swiper-container', { slidesPerView : 3, spaceBetween: 5, prevButton: '.brand03-swiper .swiper-button-prev', nextButton: '.brand03-swiper .swiper-button-next', breakpoints: { 767: { slidesPerView: 1, } } }); if($(window).width()>767){ if($(".brand03-swiper .swiper-slide").length>3){ $(".brand03-swiper .swiper-button-prev,.brand03-swiper .swiper-button-next").show() } else{ $(".brand03-swiper .swiper-button-prev,.brand03-swiper .swiper-button-next").hide() } } else{ if($(".brand03-swiper .swiper-slide").length>1){ $(".brand03-swiper .swiper-button-prev,.brand03-swiper .swiper-button-next").show() } else{ $(".brand03-swiper .swiper-button-prev,.brand03-swiper .swiper-button-next").hide() } } } //caseAjax function caseAjax(str,url){ $.ajax({ url:url, success:function(msg){ $(str).html(""); $(str).append(msg); } }); } //滚动条 function ScollText(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } function wowDelay(box,row,delayTime){ $(box).children().each(function(index){ for(var i = 0;i