//选中项显示对应内容 $(".solution-box > .item").on('mouseenter', function() { var index = $(this).index(); var dataImage = $(this).attr('data-image'); //获取背景图地址 $(this).addClass('bg').siblings().removeClass('bg'); $(".solution-box > .content > .item").eq(index).addClass('show').siblings().removeClass('show'); //改变背景图 $(".solution-box").css({ 'background-image': 'url(' + dataImage + ')' }) //背景图模糊 $(".solution-box").addClass('bg-blur'); }) //鼠标移开此区域,去掉show类名 $(".solution-box").on('mouseleave', function() { $(".solution-box > .item").removeClass('bg'); $(".solution-box > .content > .item").removeClass('show'); //背景图清晰 $(".solution-box").removeClass('bg-blur'); }) //解决方案手机滚动 require(['swiper'], function (s) { var solutionBoxPhone = new Swiper('#solu-phone.solution-box-phone', { autoplay: 4000, speed: 1000, loop: true, effect: 'cube', cube: { shadow: false, }, pagination: '.swiper-pagination', paginationClickable: true, autoplayDisableOnInteraction: false, prevButton: '#solu-phone .prev-btn', nextButton: '#solu-phone .next-btn', }) }) //首页新闻滚动 require(['swiper'], function (s) { var mySwiper = new Swiper('#index_news.index_news_swiper', { autoplay: 5000, //可选选项,自动滑动 loop: true, slidesPerView: 3, //'auto' // 间距 spaceBetween: 20, prevButton: '#index_news .swiper-button-prev', nextButton: '#index_news .swiper-button-next', breakpoints: { //当宽度小于等于768 768: { slidesPerView: 1, spaceBetween: 20 }, //当宽度小于等于1024 1024: { slidesPerView: 2, spaceBetween: 30 } } }) })