;(function($,undefined){ let he= $(".proinfo_banner .le .show dl dd img").height() let t1; function Tab (){ this.addClass=function (num){ $(".proinfo_banner .le .tab li").eq(num).addClass("active").siblings().removeClass("active") }; this.run = function (t1,he){ t1>(he*1.7) ? this.addClass(2): (t1>(he*0.7) ? this.addClass(1) :this.addClass(0)) }; this.scroll_top = function (distance){ $(".proinfo_banner .le .show dl").scrollTop(distance) }; this.tab = function(index){ index==0 ? this.scroll_top(0) : ( index==1 ? this.scroll_top(he) : this.scroll_top(he*2)) } } let tab_sub = new Tab() $(".proinfo_banner .le .tab li").click(function(){ let dex = $(this).index() tab_sub.tab(dex) }) $(".proinfo_banner .le .show dl").scroll(function(){ t1 = $(".proinfo_banner .le .show dl").scrollTop() tab_sub.run(t1,he) }) const pro03Swiper = new Swiper ('.pro03Swiper', { // 如果需要分页器 pagination: { el: '.pro03Swiper-pagination', clickable: true, }, loop:true, slidesPerView: 3, loopAdditionalSlides: 2, spaceBetween:30, autoplay: { delay: 6000, stopOnLastSlide: false, disableOnInteraction: false, }, speed:1000, breakpoints: { 768: { //当屏幕宽度大于等于768 slidesPerView: 1, spaceBetween: 20 }, } }) })(jQuery)