$(".index-form .icon-guanbi").on("click", function () { $(".index-form").addClass("active"); setTimeout(function () { $(".index-form").removeClass("active"); }, 8000) }) $("iframe").each(function(){ $(this).attr("allowfullscreen",""); var src = $(this).attr("src"); $(this).attr("src",src); }) $(".header .header-search .icon-sousuo").on("click", function () { var this_ = $(".header .header-search .searchbox") this_.hasClass("active") ? this_.removeClass("active") : this_.addClass("active") }) $(document).ready(function () { var swi = true; $(document).on("scroll", scro) scro(); function scro() { var thisH = $(this).scrollTop(); if (thisH >= 20 && swi) { $(".header").addClass("active") swi = false; } else if (thisH < 20 && !swi) { $(".header").removeClass("active") swi = true; } if (thisH > 0) { $(".backTop").show() } else { $(".backTop").hide() } } }); $(".m-right-buttom").click(function () { $(this).hasClass("active") ? $(this).removeClass("active") : $(this).addClass("active"); if (!$(".m-navbar").hasClass("active")) { $('.m-navbar').fadeIn(360).addClass("active") var liTime = 0.12; $(".m-navbar li").each(function () { $(this).css('transition-delay', liTime + 's'); liTime += 0.12; }); } else { $('.m-navbar').fadeOut(360).removeClass("active") $(".m-navbar li").css('transition-delay', '0s') } }) var innerNav; if ($(".innerNav .swiper").length > 0) { innerNav = new Swiper(".innerNav .swiper", { slidesPerView: "auto", }) innerNav.slideTo($(".innerNav .content1600 .swiper-slide.active").index()) } $(".backTop").click(function () { $('body,html').stop().animate({ scrollTop: 0 }, 400) }) $(function () { // setLoaction() var href = window.location.href; var array = href.split("#"); if (array.length > 1) { var offset = $("." + array[1]).offset()?.top $("html,body").animate({ scrollTop: offset - $(".header").height() }, 300); } }()) window.onhashchange = function () { setLoaction() }; $(".header .nav ul li .subNav .subNav-b a").click(function () { setLoaction() }) function setLoaction() { var href = window.location.href; var array = href.split("#"); if (array.length > 1) { var offset = $("." + array[1]).offset()?.top $("html,body").animate({ // scrollTop: offset - $(".header").height() scrollTop: offset - $(".header").height() }, 300); } } $(".m-navbar li>a").click(function () { var $this = $(this).parent(); if ($this.find(".subNav").length > 0) { $this.siblings("").find(".subNav").slideUp(); $this.siblings("").removeClass("active"); $this.toggleClass("active"); $this.find(".subNav").slideToggle(); } }) new WOW().init() $(".header .headerSearch").click(function (e) { e.stopPropagation() e.preventDefault() }) $(".header .headerSearch .searchBtn,.header .headerSearch .searchContainer .submit").click(function (e) { $(".header .headerSearch .searchContainer").slideToggle() }) $(document).click(function () { $(".header .headerSearch .searchContainer").slideUp() }) $(".video-content .close,.video-modal .shadow").click(function () { $(".video-modal").hide() $(".video-content").find("video")[0].pause() }) $(".playBtn").click(function () { $(".video-modal").show() $(".video-content").find("video").attr("src", $(this).data("src")) $(".video-content").find("video")[0].play() }) $(".modal .close").click(function () { $(this).parents(".modal").hide() }) if ($(".innerNav .swiper").length > 0) { new Swiper(".innerNav .swiper", { slidesPerView: "auto", }) } if ($(".serviceSupport .swiper").length > 0) { //var serviceSupport = new Swiper(".serviceSupport .swiper", { // autoplay: true, // slidesPerView: "auto", // centerInsufficientSlides: true, // pagination: { // el: ".serviceSupport .swiper-pagination", // clickable: true, // }, //}) } // var length = $(".recommendProduct.box6 .box-c .items").length // for (var i = 0; i < length; i++) { // var ele = $(".recommendProduct.box6 .box-c .items").eq(i).find(".swiper") // new Swiper(ele[0], { // autoplay: true, // observer: true, //寮€鍚姩鎬佹鏌ュ櫒锛岀洃娴媠wiper鍜宻lide // observeParents: true, //鐩戞祴Swiper 鐨勭/鐖跺厓绱 // slidesPerView: "auto", // pagination: { // el: ele.siblings(".swiper-pagination")[0], // clickable: true, // }, // }) // } $(".recommendProduct .productBtn").hover(function () { $(this).addClass("active").siblings().removeClass("active") $(".recommendProduct .box-c .items").eq($(this).index()).addClass("active").siblings().removeClass("active") }) $(".mobileNav").click(function () { $(this).toggleClass("active") $(this).find(".mobileNav-b").slideToggle() }) new Swiper(".header li .swiper", { slidesPerView: "auto", navigation: { nextEl: ".header li .btn-next", prevEl: ".header li .btn-prev", }, }) // $(".header .r .nav .subNav-c-r .items2 .item-t").click(function() { // var parent = $(this).parent() // var index = parent.index() // parent.addClass("active").siblings().removeClass("active").find(".item-c").slideUp() // parent.find(".item-c").slideDown() // }) // $(".header .r .nav .subNav-c-r .items2 .item").hover(function () { // // var parent = $(this).parent() // // var index = parent.index() // $(this).find(".item-c").stop(true) // $(this).addClass("active").siblings().removeClass("active").find(".item-c").slideUp(300) // $(this).find(".item-c").slideDown(300) // }, function () { // // var parent = $(this).parent() // $(this).find(".item-c").stop(true) // $(this).removeClass("active").find(".item-c").slideUp(300) // }) $(".header .r .nav .subNav-t .swiper-slide").hover(function () { var index = $(this).index() $(".header .r .nav .subNav-c-l a").removeClass("active") $(this).addClass("active").siblings().removeClass("active") $(".header .r .nav .subNav-c-r .items1").removeClass("active") $(".header .r .nav .subNav-c-r .items2").addClass("active") $(".header .r .nav .subNav-c-r .items2 .itemBox").eq(index).addClass("active").siblings().removeClass( "active") }) $(".header .r .nav .subNav-c-l a").hover(function () { var index = $(this).index() $(".header .r .nav .subNav-t .swiper-slide").removeClass("active") $(this).addClass("active").siblings().removeClass("active") $(".header .r .nav .subNav-c-r .items2").removeClass("active") $(".header .r .nav .subNav-c-r .items1").addClass("active") $(".header .r .nav .subNav-c-r .items1 .itemBox").eq(index).addClass("active").siblings().removeClass( "active") }) $(".header .r .subNav2 .subNav2Container-l a").hover(function () { var index = $(this).index() $(this).addClass("active").siblings().removeClass("active") var parend = $(this).parents("li") var i = parend.index() console.log(i,$(".header .r .ul li").eq(i).find(".subNav2Container-r .items")) $(".header .r .nav li").eq(i).find(".subNav2Container-r .items").eq(index).addClass("active").siblings().removeClass("active") }) // kf $(".right-close").click(function () { $('.right-flex').toggleClass("show"); if ($('.right-flex').hasClass("show")) { $('.right-flex').find("li").fadeIn() } else { $('.right-flex').find("li").fadeOut() } }); $(".right-flex .to-top").click(function () { $("html,body").animate({ "scrollTop": 0 }, 1000); }); $(".popmore").click(function () { $(".shadow").show(); $(".popupBox").show(); }) $(".close").click(function () { $(".shadow").hide(); $(".popupBox").hide(); })