$(function(){ // 首页 // 关于老肯 $('.aboutl .item').on('mouseenter',function(){ $(this).addclass('active').siblings().removeclass('active'); var i =$(this).index(); $('.about-item').eq(i).addclass('selected').siblings().removeclass('selected') }) $('.aboutl .item').on('click',function(){ $(this).addclass('active').siblings().removeclass('active'); var i =$(this).index(); $('.about-item').eq(i).addclass('selected').siblings().removeclass('selected') }) var hist = new swiper(".hist-swiper", { loop: true, spacebetween: 10, resistanceratio : 0, watchslidesprogress: true, allowtouchmove: false, navigation: { nextel: ".his-t .next", prevel: ".his-t .prev", }, controller: { control: hisb, //控制swiper1 by: 'container', }, }); var hisb = new swiper(".hisb-swiper", { loop: true, // spacebetween: 10, slidesperview: 9, // slidetoclickedslide: true, centeredslides : true, allowtouchmove: false, // freemode: true, watchslidesprogress: true, navigation: { nextel: ".his-t .next", prevel: ".his-t .prev", }, on:{ init: function(swiper){ his_position(); }, slidechangetransitionstart: function(){ his_position(); }, slidermove: function(){ his_position(); }, slidechangetransitionend: function(){ his_position(); }, touchmove: function(swiper,event) { his_position(); }, touchend: function(swiper,event) { his_position(); }, touchstart: function(swiper,event) { his_position(); }, } }); $('.his-b .prev').click(function () { hist.slideprev(); hisb.slideprev(); }) $('.his-b .next').click(function () { hist.slidenext(); hisb.slidenext(); }) function his_position() { $(".hisb-swiper .swiper-slide").removeclass("prev_nth2mode next_nth2mode prev_nth3mode next_nth3mode prev_nth4mode next_nth4mode prev_nth5mode next_nth5mode prev_nth6mode next_nth6mode"); $(".hisb-swiper .swiper-slide-active").prev().addclass("prev_nth2mode"); $(".hisb-swiper .swiper-slide-active").next().addclass("next_nth2mode"); $(".hisb-swiper .swiper-slide-active").prev().prev().addclass("prev_nth3mode"); $(".hisb-swiper .swiper-slide-active").next().next().addclass("next_nth3mode"); $(".hisb-swiper .swiper-slide-active").prev().prev().prev().addclass("prev_nth4mode"); $(".hisb-swiper .swiper-slide-active").next().next().next().addclass("next_nth4mode"); $(".hisb-swiper .swiper-slide-active").prev().prev().prev().prev().addclass("prev_nth5mode"); $(".hisb-swiper .swiper-slide-active").next().next().next().next().addclass("next_nth5mode"); $(".hisb-swiper .swiper-slide-active").prev().prev().prev().prev().prev().addclass("prev_nth6mode"); $(".hisb-swiper .swiper-slide-active").next().next().next().next().next().addclass("next_nth6mode"); } var hbswiper = new swiper(".partner .hb-swiper", { slidesperview: 2, slidespercolumn: 3, // grid: { // rows: 3, // }, spacebetween: 10, pagination: { el: ".hb .pagi", clickable: true, }, autoplay: { delay: 4000, stoponlastslide: false, disableoninteraction: false, }, breakpoints: { 320: { spacebetween: 10, slidesperview: 2, }, 641: { spacebetween: 20, slidesperview: 3, }, 1261: { spacebetween: 20, slidesperview: 4, }, 1441: { spacebetween: 33, slidesperview: 4, } } }); // 品牌文化 var culture = new swiper(".culture-swiper", { slidesperview: 2, pagination: { el: ".swiper-pagination", clickable: true, }, breakpoints: { 320: { slidesperview: 2, }, 641: { slidesperview: 3, }, 1025: { slidesperview: 4, }, 1260: { slidesperview: 5, } } }); var activity = new swiper(".activity-swiper", { slidesperview: 1, spacebetween: 10, speed:1000, loop:true, breakpoints: { 320: { slidesperview: 1, spacebetween: 10, }, 641: { slidesperview: 2, spacebetween: 30, }, 769: { slidesperview: 2, spacebetween: 20, }, 1025: { slidesperview: 3, spacebetween: 35, }, 1260: { slidesperview: 3, spacebetween: 40, }, 1441: { slidesperview: 3, spacebetween: 50, } } }); $('.activity .prev').on('click',function(){ activity.slideprev(); }) $('.activity .next').on('click',function(){ activity.slidenext(); }) var duty = new swiper(".duty-swiper", { spacebetween: 10, speed:1000, loop:true, }); $('.duty .prev').on('click',function(){ duty.slideprev(); }) $('.duty .next').on('click',function(){ duty.slidenext(); }) var qysp = new swiper(".qysp-swiper", { spacebetween: 10, speed:1000, loop:true, on:{ click: function(){ var i = this.clickedindex; // console.log(i,222); }, }, }); $('.qysp-swiper .swiper-slide').on('click',function(){ $(this).children('.sp-wrap').addclass('hide'); console.log(222); }) $('.qysp-swiper .swiper-slide').on('touchend',function(){ $(this).children('.sp-wrap').addclass('hide'); $(this).children('.video')[0].play() }) $('.qysp .prev').on('click',function(){ qysp.slideprev(); }) $('.qysp .next').on('click',function(){ qysp.slidenext(); }) // 新闻资讯 var news = new swiper('.news-swiper', { loop:true, speed:1000, spacebetween: 10, autoplay: { delay: 4000, stoponlastslide: false, disableoninteraction: false, }, pagination: { el: '.news-t .swi-pagi', clickable: true, }, }); if($('.news-swiper .swiper-slide').length == 0) { $('.news-t').remove() } // 产品&解决方案1 $('.product-item').each(function(){ var contentlen = $(this).children('.txt').find('.more-intro').children('.intro').children('').length; if (contentlen == 0) { $(this).children('.txt').find('.more').remove(); } }) $('.product-item').on('click',function(){ var content = $(this).children('.txt').find('.more-intro').children('.intro').children(''); var inconlen = content.length; if (inconlen !== 0) { if($(this).hasclass('cur') ){ $(this).removeclass('cur').siblings().removeclass('cur'); $(this).children('.txt').find('.more-intro').stop(true,false).slideup(300); $(this).siblings().children('.txt').find('.more-intro').stop(true,false).slideup(300); } else { $(this).addclass('cur').siblings().removeclass('cur'); $(this).children('.txt').find('.more-intro').stop(true,false).slidedown(300); $(this).siblings().children('.txt').find('.more-intro').stop(true,false).slideup(300); } }else { $(this).children('.txt').find('.more').remove(); } }) var solution3 = new swiper(".solu-swiper", { slidesperview: 1, spacebetween: 10, // loop:true, speed:1000, observer: true, observeslidechildren: true, autoheight: true, pagination: { el: ".solu-swiper .swiper-pagination", type: "progressbar", }, breakpoints: { 320: { slidesperview: 1, spacebetween: 10 }, 641: { slidesperview: "auto", spacebetween: 10 }, 1280: { slidesperview: "auto", spacebetween: 13 } } }); })