$(function () { //$(".e_floatingShoppingCart-14").appendTo(".header .topbar > div.it_cart"); $(".p_iconBox").click(function () { $(this).toggleClass("open"); $(".header").toggleClass("show"); // $(".header ul").slideToggle(500); }) $(".header .topbar > div.it_user").hover(function () { $(this).children(".quickLogin").stop().slideToggle(300); }) $(".header ul li.p_level1Item").each(function (index) { $(this).hover(function () { $(".header ul li.p_level1Item.actived").removeClass("actived"); //注意这里 $(this).addClass("actived"); //注意这里 var topx = $(this).offset().top; $(".header ul .navimgbox .imgitem.actived").removeClass("actived"); $(".header ul .navimgbox .imgitem").eq(index).addClass("actived"); $(".header ul .waveCanvas").css("top", topx); }); }) }) //top fixed $(window).scroll(function () { if ($(window).scrollTop() > 0) { $('.fIxBox').parent().addClass('active') } else { $('.fIxBox').parent().removeClass('active') } }) $('.fIxBox').parent().mouseenter(function () { $(this).addClass('active') }).mouseleave(function () { if ($(window).scrollTop() == 0) { $(this).removeClass('active') } }); //top nav $(function () { var wind_w = $(window).width(); $('.e_navigationF-24 .p_navItem1 .sj_warp').find('.p_level3Box').parents('.p_navItem1').addClass('pro_li'); $('.e_navigationF-24 .pro_li .dropdown .left ul .p_navItem2').eq(0).addClass('cur'); $('.e_navigationF-24 .pro_li .dropdown .center .sj_warp ul').eq(0).addClass('pro_cur'); if (wind_w > 768) { $('.e_navigationF-24 .pro_li .dropdown .left ul').on('mouseenter', 'li', function () { $(this).addClass('cur').siblings().removeClass('cur'); var index = $(this).index(); $(this).closest('.dropdown').find('.sj_warp ul').eq(index).stop().fadeIn().siblings().hide(); }) } $('.search_warp').click(function () { if ($('.boxForm').hasClass('active')) { $('.boxForm').removeClass('active'); } else { $('.boxForm').addClass('active'); } }) $('.closeFrom').click(function () { $('.boxForm').removeClass('active'); }) }); //Parallax if ($("#cur").length > 0) { var cur = document.getElementById('cur'); var parallaxInstance3 = new Parallax(cur, { selector: ".cur_point_e", invertX: false, invertY: false, originX: 0, originY: 0, frictionX: 0.25, frictionY: 0.25, }); } //Parallax //指针hover按钮 $("a , .c_btn, .swiper-pagination-hpro, .pswiper-button-prev, .pswiper-button-next, #w_fimg-1613960944387, .p_page .pre, .p_page .pageNum, .p_page .next, .p_page .jump, .e_RelationBtn, .swiper-button-prev, .swiper-button-next, .d_tagA, .btn-primary").on("mouseenter", function () { $("body").addClass("cur_on"); }); $("a , .c_btn, .swiper-pagination-hpro, .pswiper-button-prev, .pswiper-button-next, #w_fimg-1613960944387, .p_page .pre, .p_page .pageNum, .p_page .next, .p_page .jump, .e_RelationBtn, .swiper-button-prev, .swiper-button-next, .d_tagA, .btn-primary").on("mouseleave", function () { $("body").removeClass("cur_on"); }); //指针hover按钮 //go top $("#w_fimg-1613960944387").on("click", function () { $("html,body").stop().animate({ scrollTop: 0 }, 500); }); // Loading $(function () { if (isFrontEnv()) { let wd = {}; wd.ani = gsap; wd.banner_svg = function () { let _this = $(this); let a = $(this).find("path"); return { hide: function () { a.each(function () { let width = this.getTotalLength(); wd.ani.set(this, { "stroke-dasharray": width, "stroke-dashoffset": width + 5 }); }); return this; }, show: function ({ delay } = { delay: 1 }) { setTimeout(() => { a.each(function (i) { wd.ani.to(this, { "stroke-dashoffset": 0, duration: 5, dalay: i * 0.1 }); }); setTimeout(() => { a.each(function (i) { wd.ani.to(this, { fill: "#fff", duration: 1, dalay: i * 0.1 }); }); }, 1200); }, delay * 1000); } }; }; wd.banner_svg.call($(".loadingBox").find("svg")).hide().show({ delay: 1.1 }); } });