"use strict"; (function () { console.log("娴忚鍣ㄥ垎杈ㄧ巼鏄? + document.documentElement.clientWidth + "*" + document.documentElement.clientHeight); console.log("灞忓箷鍒嗚鲸鐜囨槸" + window.screen.width + "*" + window.screen.height); let pageVar = $("meta[name='generator']")[0].dataset.var; pageVar = pageVar.split("|"); pageVar = { pageUrl: pageVar[0], acode: pageVar[1], template: pageVar[2], tcode: pageVar[3], pcode: pageVar[4], scode: pageVar[5], }; let isPc = true; let isPad = false; let isPhone = false; checkSize() $(window).resize(function () { checkSize() }); function checkSize() { let windowsWidth = document.documentElement.clientWidth; if (windowsWidth > 991) { isPc = true; isPad = false; isPhone = false; console.log("isPc", isPc); } else if (windowsWidth >= 768 && windowsWidth <= 991) { isPc = false; isPad = true; console.log("isPad", isPad); } else if (windowsWidth < 768) { isPc = false; isPad = false; isPhone = true; console.log("isPhone", isPhone); } console.log("windowsWidth", windowsWidth); } var mybanner = new Swiper('#sw_banner', { loop: true, speed: 300, autoplay: { disableOnInteraction: false, delay: 4000 }, navigation: { nextEl: '.swiper-button-next-banner', prevEl: '.swiper-button-prev-banner', }, pagination: { el: '.swiper-pagination-banner', clickable: true, }, on: { init: function (item) { bannerReSize() } } }) var sw_pagebanner = new Swiper('#sw_pagebanner', { loop: true, speed: 300, on: { init: function (item) { bannerReSize(item) } } }) function bannerReSize(e) { // console.log(e); let pcHeight = $(".sw_banner")[0].dataset.pcheight; let padHeight = $(".sw_banner")[0].dataset.padheight; let phoneHeight = $(".sw_banner")[0].dataset.phoneheight; if (isPc) { $(".sw_banner .swiper-slide").css({ "background-size": "auto " + pcHeight + "px", "height": pcHeight + "px" }) $(".sw_banner .swiper-slide div").css({ "height": pcHeight + "px" }) } if (isPad) { $(".sw_banner .swiper-slide").css({ "background-size": "auto " + padHeight + "px", "height": padHeight + "px" }) $(".sw_banner .swiper-slide div").css({ "height": padHeight + "px" }) } if (isPhone) { $(".sw_banner .swiper-slide").css({ "background-size": "auto " + phoneHeight + "px", "height": phoneHeight + "px" }) $(".sw_banner .swiper-slide div").css({ "height": phoneHeight + "px" }) } } $(window).resize(function () { bannerReSize() console.log("bannerUpdata"); } ); var index_case_sw = new Swiper('#index_img_sw', { autoplay: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 3, spaceBetween: 20, breakpoints: { 1024: { slidesPerView: 3, }, 768: { slidesPerView: 3, }, 640: { slidesPerView: 2, }, 320: { slidesPerView: 2, } }, navigation: { nextEl: '.swiper_button_next_product', prevEl: '.swiper_button_prev_product', }, }) var mySwiper_product2 = new Swiper('#index_product2_sw',{ autoplay:true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 4, spaceBetween : 20, breakpoints: { 1024: { slidesPerView: 4, }, 768: { slidesPerView: 3, }, 640: { slidesPerView: 2, }, 320: { slidesPerView: 2, } }, }) $('.clearfix iframe').css('height', $('.clearfix iframe').width() * 0.56) // new WOW().init(); }());