$(function(){ if($(".pipeline_pub").length>0){ var $anchorTop=$('.pipeline_pub').offset().top-114; //console.log($anchorTop); $(window).scroll(function(){ var wint=$(window).scrollTop(); var $anchor=$(wint); if (wint>$anchorTop) { $('body').addClass('pipeline_pub_fixed'); } else{ $('body').removeClass('pipeline_pub_fixed'); } }) } progress_slider(); pipelineTab(); $(document).on("click",".research_tab li",function(){ $(this).addClass("on").siblings().removeClass("on"); $(".research_ul").eq($(this).index()).show().siblings().hide(); imgratio(); }) }) function progress_slider(){ if($(".progress_slider li").length>1){ var brand3Swiper = new Swiper('.progress_slider .swiper-container', { slidesPerView: 3, slidesPerGroup: 1, spaceBetween: 24, prevButton:'.progress_slider .swiper-button-prev', nextButton:'.progress_slider .swiper-button-next', breakpoints:{ //褰撳搴﹀皬浜庣瓑浜?024 767: { slidesPerView: 1, spaceBetween: 0 }, } }) } if($(window).width()>767){ if($(".progress_slider li").length>3){ $(".progress_slider .honor_but").show(); } }else{ if($(".progress_slider li").length>1){ $(".progress_slider .honor_but").show(); } } } function pipelineTab(){ setTimeout(function () { $(".pipeline_tab li").eq(0).click(); }, 200); if($(window).width()>1024){ if($(".pipeline_tab li").length>1){ // $(".pipeline_tab .but_pub").show() } }else{ if($(".pipeline_tab li").length>1){ $(".pipeline_tab .but_pub").show() } } if($(".pipeline_tab li").length>1){ var pro3 = new Swiper('.pipeline_tab .swiper-container', { nextButton: '.pipeline_tab .swiper-button-next', prevButton: '.pipeline_tab .swiper-button-prev', slidesPerView: "auto", slidesPerGroup: 1, paginationClickable: true, spaceBetween: 50, noSwiping : true, onInit: function(swiper){ var i = $('.pipeline_tab .swiper-slide.on').index(); swiper.slideTo(i-1); }, breakpoints: { 767: { slidesPerView: 1, } } }); } var _ind = 0; var _len = $(".pipeline_tab .swiper-slide").length; var url = $(".pipeline_tab .swiper-slide").eq(0).data("src"); btnJudge(); $(".pipeline_tab .swiper-slide").click(function(){ var url = $(this).data("src"); if(url == ""){ return false; }else{ pipelineAjax(".pipeline_block",url) } _ind = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); pro3.slideTo(_ind, 1000, false); btnJudge(); imgratio(); imgratio2(); }) $(".pipeline_tab .swiper-button-prev").click(function() { _ind--; btnJudge() $(".pipeline_tab .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".pipeline_tab .swiper-slide.on").click(); // var srcurl=$(".pipeline_tab .swiper-slide").eq(_ind).find("img").attr("src"); // console.log(srcurl) // $(".pro_bigimg img").attr("src",srcurl) imgratio(); imgratio2(); }) //鐐瑰嚮鍙堟寜閽紝瀹炵幇_ind鑷姞1 $('.pipeline_tab .swiper-button-next').click(function() { _ind++; btnJudge() $(".pipeline_tab .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".pipeline_tab .swiper-slide.on").click(); // var srcurl=$(".pipeline_tab .swiper-slide").eq(_ind).find("img").attr("src"); // console.log(srcurl) // $(".pro_bigimg img").attr("src",srcurl); imgratio(); imgratio2(); }) function btnJudge() { if(_ind >= _len - 1) { $('.pipeline_tab .swiper-button-next').addClass("disabled") _ind = _len - 1; } else { $('.pipeline_tab .swiper-button-next').removeClass("disabled") } if(_ind <= 0) { $(".pipeline_tab .swiper-button-prev").addClass("disabled") _ind = 0; } else { $(".pipeline_tab .swiper-button-prev").removeClass("disabled") } } } function pipelineAjax(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(); if($(window).width()>1024){ ScollText(".pi_table_b"); } } }); }