// JavaScript Document $(function() { $(window).scroll(function() { if ($(window).scrollTop() > 200) { $(".headerW").addClass("headerB"); } else { $(".headerW").removeClass("headerB"); } }); reSizeLoad(); // 调整窗口刷新页面 // $(window).resize(function() { // //reSizeLoad(); // location.reload() //这里你可以写你的刷新代码! // }); function reSizeLoad() { var swiper_envi = new Swiper('.swiper-envi', { speed: 500, autoplay: { delay:5000, }, slidesPerView: 1, on: { slideChangeTransitionStart: function(){ swiper_envis.slideTo(this.activeIndex); }, }, }); var swiper_envis = new Swiper('.swiper-envis', { speed: 500, autoplay: { delay:5000, }, navigation: { nextEl: '.swiper-envis-con .swiper-button-next', prevEl: '.swiper-envis-con .swiper-button-prev', }, slidesPerView: 4, slideToClickedSlide: true, normalizeSlideIndex: false, on: { slideChangeTransitionStart: function(){ swiper_envi.slideTo(this.activeIndex); }, }, }); }; $(".advaBox li").hover(function(){ var num=$(this).index(); console.log(num); $(this).addClass("active"); $(this).siblings().removeClass("active"); }); });