$(window).on("scroll",function(){ var windowWidth = $(window).width(); if(windowWidth > 640){ //pc顶部背景更换 if($(document).scrollTop()> 0){ $(".header").addClass('header1'); }else{ $(".header").removeClass("header1"); } }else{ $(".header").removeClass("header1"); } }); $(function(){ "use strict"; // var windowWidth = $(window).width(); //bnner var banswiper = new Swiper('.swiper-container.ban', { slidesPerView: 1, pagination: { el: '.ban .swiper-pagination', clickable :true, }, navigation: { nextEl: '.ban .swiper-button-next', prevEl: '.ban .swiper-button-prev', }, }); //精品项目 var projectswiper = new Swiper('.ind-project .swiper-container', { slidesPerView: 1, pagination: { el: '.ind-project .swiper-pagination', }, navigation: { nextEl: '.ind-project .swiper-button-next', prevEl: '.ind-project .swiper-button-prev', }, }); //合作伙伴 var partnerswiper = new Swiper('.ind-partner .swiper-container', { slidesPerView: 1, pagination: { el: '.ind-partner .swiper-pagination', }, navigation: { nextEl: '.ind-partner .swiper-button-next', prevEl: '.ind-partner .swiper-button-prev', }, }); });