i-pagination", clickable: true, } }); var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || document.body.offsetWidth; //视窗宽度 if (screenWidth < 1020) { var swiper = new Swiper("#product-anli", { slidesPerView: 1, slideToClickedSlide: true, speed: 500, spaceBetween: 24, pagination: { el: ".product-anli-pagination", clickable: true, } }); } // 产品案例轮播 new Swiper("#product-case", { loop: true, // 循环模式选项 loopAdditionalSlides: 1, slidesPerView: 'auto', slideToClickedSlide: true, spaceBetween: 0, centeredSlides: true, observer: true, observeParents: true, pagination: { el: ".product-case-pagination", clickable: true, }, autoplay: { delay: 3000, // 自动切换的时间间隔,单位ms disableOnInteraction: false, // 用户操作后是否停止自动播放 }, on: { init: function (swiper) { handleSwipeData($("#product-case .product-case-list").find(".swiper-slide-active")[0]) }, transitionEnd: function (swiper, event) { handleSwipeData($("#product-case .product-case-list").find(".swiper-slide-active")[0]) } } }); function handleSwipeData(data) { var tag = $(data).attr("data-tag").split("|") var title = $(data).attr("data-title") var desc = $(data).attr("data-desc") if (!desc) desc = "" $("#product-case-bottom").find("h1").html(title) $("#product-case-bottom").find("p").html(desc) var html = ''; for (var i = 0; i < tag.length; i++) { html += '' + tag[i] + '' } $("#product-case-bottom").find(".product-case-tag").html(html) $.each($("#product-case .product-case-list .product-case-item"), function (i, dom) { if ($(dom).hasClass("swiper-slide-active")) { $(dom).attr("href", $(dom).attr("data-href")) } else { $(dom).attr("href", "javascript:void(0)") } }); } function scrollPageAction(top) { if (top > document.body.clientHeight) { if (!$("#public-top-btn").hasClass("show")) { $("#public-top-btn").addClass("show") } } else { $("#public-top-btn").removeClass("show") } } $("#public-top-btn").click(function () { $("html,body").animate({ scrollTop: "0px" }, 500); }) // 初始化WOW动画 if (!/msie [6|7|8|9]/i.test(navigator.userAgent)) { new WOW().init(); }