$(function(){ if($(window).width()>1024){ setTimeout(function(){ $(".history_year .swiper-slide-active").click(); },200) $(".history_year .swiper-slide").click(function(){ var url = $(this).data("src"); if(url == ""){ return false; }else{ hisAjax(".about_histop",url) } $(this).addClass("on").siblings().removeClass("on"); }) var aboutswiper = new Swiper('.gallery-thumbs', { nextButton: '.history_year .swiper-button-next', prevButton: '.history_year .swiper-button-prev', slidesPerView:5, centeredSlides: true, mousewheelControl: false, direction :'vertical', initialSlide :$(".history_year .leftbox .swiper-slide").length,//璁惧畾鍒濆鍖栨椂slide鐨勭储寮曘€ resistanceRatio : 0.3, followFinger : true, slideToClickedSlide: true,//璁剧疆涓簍rue鍒欑偣鍑籹lide浼氳繃娓″埌杩欎釜slide銆 onTouchMove: function (swiper) { his_position(); }, onTouchEnd: function (swiper) { his_position(); }, onSlideChangeStart: function (swiper) { his_position(); }, onInit: function(swiper){ his_position(); } }); $(".ie9 .swiper-button-next,.ie9 .swiper-button-prev").click(function(){ his_position(); }) }else{ if($(".history_year .swiper-slide").length>1){ $(".but_year").show(); } hisslider(); } }) function his_position() { $(".gallery-thumbs .swiper-slide").removeClass("prev_nth2Mode next_nth2Mode prev_nth3Mode next_nth3Mode prev_nth4Mode next_nth4Mode prev_nth5Mode next_nth5Mode prev_nth6Mode next_nth6Mode"); $(".gallery-thumbs .swiper-slide-active").prev().addClass("prev_nth2Mode"); $(".gallery-thumbs .swiper-slide-active").next().addClass("next_nth2Mode"); $(".gallery-thumbs .swiper-slide-active").prev().prev().addClass("prev_nth3Mode"); $(".gallery-thumbs .swiper-slide-active").next().next().addClass("next_nth3Mode"); $(".gallery-thumbs .swiper-slide-active").prev().prev().prev().addClass("prev_nth4Mode"); $(".gallery-thumbs .swiper-slide-active").next().next().next().addClass("next_nth4Mode"); $(".gallery-thumbs .swiper-slide-active").prev().prev().prev().prev().addClass("prev_nth5Mode"); $(".gallery-thumbs .swiper-slide-active").next().next().next().next().addClass("next_nth5Mode"); $(".gallery-thumbs .swiper-slide-active").prev().prev().prev().prev().prev().addClass("prev_nth6Mode"); $(".gallery-thumbs .swiper-slide-active").next().next().next().next().next().addClass("next_nth6Mode"); } function hisslider(){ setTimeout(function () { $(".history_year .swiper-slide").eq(0).click(); }, 200); if($(window).width()>767){ if($(".history_year .swiper-slide").length>5){ $(".history_year .but_pub02").show() } }else{ if($(".history_year .swiper-slide").length>3){ $(".history_year .but_pub02").show() } } if($(".history_year .swiper-slide").length>1){ var pro3 = new Swiper('.history_year .swiper-container', { nextButton: '.history_year .swiper-button-next', prevButton: '.history_year .swiper-button-prev', slidesPerView: 5, slidesPerGroup: 1, paginationClickable: true, spaceBetween: 0, noSwiping : true, onInit: function(swiper){ var i = $('.history_year .swiper-slide.on').index(); swiper.slideTo(i-1); }, breakpoints: { 767: { slidesPerView: 3, } } }); } var _ind = 0; var _len = $(".history_year .swiper-slide").length; var url = $(".history_year .swiper-slide").eq(0).data("src"); btnJudge(); $(".history_year .swiper-slide").click(function(){ var url = $(this).data("src"); if(url == ""){ return false; }else{ hisAjax(".about_histop",url) } _ind = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); btnJudge(); imgratio(); }) $(".history_year .swiper-button-prev").click(function() { _ind--; btnJudge() $(".history_year .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".history_year .swiper-slide.on").click(); // var srcurl=$(".history_year .swiper-slide").eq(_ind).find("img").attr("src"); // console.log(srcurl) // $(".pro_bigimg img").attr("src",srcurl) imgratio(); }) $('.history_year .swiper-button-next').click(function() { _ind++; btnJudge() $(".history_year .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".history_year .swiper-slide.on").click(); // var srcurl=$(".history_year .swiper-slide").eq(_ind).find("img").attr("src"); // console.log(srcurl) // $(".pro_bigimg img").attr("src",srcurl); imgratio() }) function btnJudge() { if(_ind >= _len - 1) { $('.history_year .swiper-button-next').addClass("disabled") _ind = _len - 1; } else { $('.history_year .swiper-button-next').removeClass("disabled") } if(_ind <= 0) { $(".history_year .swiper-button-prev").addClass("disabled") _ind = 0; } else { $(".history_year .swiper-button-prev").removeClass("disabled") } } } function hisAjax(str,url){ if (url.indexOf('?') == -1) { url += '?tm=' + Math.random(); } else { url += '&tm=' + Math.random(); } $.ajax({ url:url, success:function(msg){ $(str).html(""); $(str).append(msg); imgratio(); imgratio2(); hislist(); } }); } function hislist(){ var num=2; if($(window).width()<=767){ var num=1; } if($(".about_hisslider li").length>=1){ var brand3Swiper = new Swiper('.about_hisslider .swiper-container', { slidesPerView: num, slidesPerGroup: 1, spaceBetween: 0, prevButton:'.about_hisslider .swiper-button-prev', nextButton:'.about_hisslider .swiper-button-next', // breakpoints:{ // 767: { // slidesPerView: 1, // slidesPerGroup: 1 // }, // } }) } if($(".about_hisslider li").length>num){ $(".about_hisslider .honor_but").show(); } }