document.oncontextmenu=function(e){return false;} //回到顶部 02 function goTop(){ $('html,body').animate({'scrollTop':0},600); } // aos AOS.init({ offset: 50, easing: 'ease-out-back', duration: 1000, disable: 'mobile' }); //导航菜单 var off=true; $(".navTrigger").click(function () { if(off==true){ $(this).addClass("navTrigger-on"); $('.wapNav').addClass("nav_on"); off=false; }else{ $(this).removeClass("navTrigger-on"); $(".wapNav").removeClass("nav_on"); off=true; } }); $('.wapNav .m').click(function(){ $(this).children('.navSub').slideToggle().end().siblings('.m').children('.navSub').slideUp(); $(this).addClass('on').siblings('li').removeClass('on'); }); $('.menuIcon').click(function() { $('.sidebar').stop(true, false).slideToggle(); }); $('.sidebarMenu>li').click(function() { $(this).children('ul').slideToggle().end().siblings('.m').children('.ul').slideUp(); $(this).addClass('cur').siblings('li').removeClass('cur'); }); $('.header .lang').click(function() { $('.langMain').stop(true, false).slideToggle(); }); /* 客服 */ $(document).ready(function(){ $(".sz-kefu .kf1").click(function(){ $('.sz-kefu .qq').find(".sidebox").stop().animate({"right":"0"},160); $(this).find(".sidebox").stop().animate({"right":"-48px"},160); }); $(".sz-kefu .qq .close").click(function(){ $('.sz-kefu .qq').find(".sidebox").stop().animate({"right":"-150px"},160); $('.sz-kefu .kf1').find(".sidebox").stop().animate({"right":"0"},160); }); $(".sz-kefu .kf3").hover(function(){ $(this).find(".sidebox").stop().animate({"width":"130px"},160); $(this).find(".sidebox3").stop().animate({"width":"200px"},160); },function(){ $(this).find(".sidebox").stop().animate({"width":"48px"},160); }); $('.sz-kefu .kf2').hover(function() { $(this).find('.kf_wx').fadeIn(); }, function() { $(this).find('.kf_wx').fadeOut(); }); }); $(".search-btn").on("click",function(){ $(".search-bar").toggleClass("show"); }) if ($('.header').length > 0) { // console.log('yes'); var pTop=$('.header').position().top; $(document).scroll(function(e){ if($(document).scrollTop()>pTop){ $('.header').addClass('fixed') }else{ $('.header').removeClass('fixed') }; }); } $(".youshi-content .item").hover(function() { $(this).addClass("on").siblings().removeClass("on"); }) // swiper start var swiperBanner = new Swiper('#banner-swiper', { pagination: { el: '#banner-swiper .swiper-pagination', clickable: true, }, // navigation: { // nextEl: '#banner-swiper .banner-next', // prevEl: '#banner-swiper .banner-prev', // }, autoplay: true, autoplay: { delay: 6000 }, loop: true, speed: 800, }); // 产品详情 var product_album = new Swiper('.product-album', { pagination: { el: '.product-head .swiper-pagination', clickable: true, }, autoplay: true, loop: true, speed: 500, }); // 荣誉 var sw_honor = new Swiper('.sw-honor', { slidesPerView: 4, spaceBetween: 13, slidesPerGroup: 4, autoplay: true, speed: 500, loop: false, pagination: { el: '.sw-honor .swiper-pagination', clickable: true, }, breakpoints: { 768: { slidesPerView: 1, slidesPerGroup: 1, }, } }) // 伙伴 var sw_partner = new Swiper('.sw-partner', { slidesPerView: 5, slidesPerColumn: 2, spaceBetween: 30, autoplay: true, speed: 500, pagination: { el: '.sw-partner .swiper-pagination', clickable: true, }, breakpoints: { 768: { slidesPerView: 2, }, } }) // 环境 var sw_hj = new Swiper('.sw-hj', { slidesPerView: 3, spaceBetween: 16, slidesPerGroup: 3, autoplay: true, speed: 500, loop: true, pagination: { el: '.sw-hj .swiper-pagination', clickable: true, }, breakpoints: { 768: { slidesPerView: 1, slidesPerGroup: 1, }, } }) // 环境 var sw_hj2 = new Swiper('.sw-hj2', { slidesPerView: 3, spaceBetween: 16, slidesPerGroup: 3, autoplay: true, speed: 500, loop: true, pagination: { el: '.sw-hj2 .swiper-pagination', clickable: true, }, breakpoints: { 768: { slidesPerView: 1, slidesPerGroup: 1, }, } }) // 首页产品切换 var index_product = new Swiper('.index-product-content', { slidesPerView: 1, spaceBetween: 20, autoplay: false, loop: false, speed: 500, on: { slideChangeTransitionStart: function() { $(".index-tab .on").removeClass('on'); $(".index-tab li").eq(this.activeIndex).addClass('on'); } } }) $(".index-tab li").on('click', function(e) { e.preventDefault(); $(".index-tab li.on").removeClass('on'); $(this).addClass('on'); index_product.slideTo($(this).index()); }) // 首页新闻切换 var index_news = new Swiper('.index-news-tab-content', { slidesPerView: 1, spaceBetween: 20, autoplay: false, loop: false, speed: 500, on: { slideChangeTransitionStart: function() { $(".index-news-tab .on").removeClass('on'); $(".index-news-tab li").eq(this.activeIndex).addClass('on'); } } }) $(".index-news-tab li").on('click', function(e) { e.preventDefault(); $(".index-news-tab li.on").removeClass('on'); $(this).addClass('on'); index_news.slideTo($(this).index()); }) // case-pic-slide-1 var case_album_1 = new Swiper('.case-pic-slide-1', { autoplay: true, loop: true, speed: 500, navigation: { nextEl: '.case-pic-slide-1 .next', prevEl: '.case-pic-slide-1 .prev', }, }); var index_case = new Swiper('.case-tab-content', { slidesPerView: 1, spaceBetween: 0, autoplay: false, loop: false, speed: 500, effect: 'fade', on: { slideChangeTransitionStart: function() { $(".case-tab .on").removeClass('on'); $(".case-tab li").eq(this.activeIndex).addClass('on'); } } }) $(".case-tab li").on('click', function(e) { e.preventDefault(); $(".case-tab li.on").removeClass('on'); $(this).addClass('on'); index_case.slideTo($(this).index()); }) // history-list var swiperHistory = new Swiper('.history-list', { slidesPerView: 3, spaceBetween: 3, autoplay: true, speed: 500, loop: true, breakpoints: { 768: { }, } }) // 环境 var swiperHJ = new Swiper('.huanjing-list', { slidesPerView: 3, spaceBetween: 30, autoplay: true, speed: 500, loop: true, navigation: { nextEl: '.xhy-huanjing .next', prevEl: '.xhy-huanjing .prev', }, breakpoints: { 768: { slidesPerView: 2, }, } }) // case-slider var swiperCase = new Swiper('.case-slider', { slidesPerView: 4, spaceBetween: 23, autoplay: true, speed: 500, loop: true, navigation: { nextEl: '.case-slider-wrap .next', prevEl: '.case-slider-wrap .prev', }, breakpoints: { 768: { slidesPerView: 2, }, } })