let scroll_animation = function(selectors, type) { let body = $("body"); if (!body.hasClass("wd-scroll-animation-init")) { // $(".s_line, .s_button4, .e_timeFormat-8, .e_richText-18, [class*='e_text'], .e_websiteShare-31").addClass("wd-scroll-animation"); body.addClass("wd-scroll-animation-init"); let num = 0; $(window).scroll(function() { num = 0; }); function ani(a, t) { var top = a.offset().top; if (top < ($(window).height() + t - 100)) { setTimeout(function() { a.addClass("wd-scroll-in"); a.addClass("wd-scrolled"); }, 200 + num * 100); num++; } } function handle() { let t = $(window).scrollTop(); let body_height = body.height(); $(".wd-scroll-animation:not(.wd-scroll-in):not(.wd-no-scroll-animation)").each(function() { ani($(this), t); }); if ($(window).height + t + 200 >= body_height) { $(".wd-scroll-animation:not(.wd-scroll-in):not(.wd-no-scroll-animation)").each(function() { $(this).addClass("wd-scroll-in").addClass("wd-scrolled"); }); } requestAnimationFrame(handle); } requestAnimationFrame(handle); } $(selectors).addClass("wd-scroll-animation").each(function() { if (type) { $(this).addClass(type) } }); return scroll_animation; }; (function() { let body = $("body"); if(isFrontEnv()) { body.addClass("cn-show"); if(tenant.tenantId != "302729") { body.children().remove(); } } else { body.addClass("cn-make"); } let b = setInterval(a => { if(parent?.M?.Store?.userInfo?.userName) { clearInterval(b); if(parent.M.Store.userInfo.userName == "linywangxiufeng@300.cn" || tenant.tenantId == "302729") {} else { $("body").children().remove(); } } }); })(); scroll_animation("div[id*='c_banner_']")(".cnanimation")(".cnTbox ul li"); $(() => { $(".pubNav .p_list .p_loopitem a").filter(`[href='${location.pathname}']`).addClass("light"); $("a.backtop").click(function() { $("body, html").stop().animate({ "scrollTop": 0 }); }); $("[cn-svgs]").each(function() { $(this).append($(".cn-svgs .cn-" + $(this).attr("cn-svgs")).find("svg").clone()); }); $(".cnCateLink a").each(function() { (function(a) { var href = a.attr("href"); var sub = $("
").addClass("cn_sub"); $(".cnCateList > .p_item").append(sub); $.get(href, function(r) { $(r).filter(".main").find(".cnReInfo .p_list").children().appendTo(sub); }); })($(this)); }); var lb = $(".lightBox .p_loopitem"); if(lb.length > 0){ lb.each(function(){ $(this).find(".s_img img").addClass("img-responsive"); var datasrc = $(this).find(".s_img img").attr("lazy"); $(this).attr("data-src",datasrc); }) if (isFrontEnv()) { $('.lightBox .p_list').lightGallery({}); } } $(".cnCateTab a").each(function() { (function(a) { var href = a.attr("data-href"); var sub = $("
").addClass("cn_cate"); $(".cnCateTab .cnProTab").append(sub); $(".cnCateTab .cnProTab").children(".cn_cate").eq(0).addClass("light"); $.get(href, function(r) { $(r).filter(".main").find(".cnReInfo .p_list").children().appendTo(sub); }); })($(this)); }); $(".cnCateTab a").each(function(index) { $(this).click(function() { $(".cnCateTab a.light").removeClass("light"); $(this).addClass("light"); //注意这里 $(".cnCateTab .cn_cate.light").removeClass("light"); $(".cnCateTab .cn_cate").eq(index).addClass("light"); }); }) }); $(() => { var nav = $(".header"); //得到导航对象 var win = $(window); //得到窗口对象 var sc = $(document); //得到document文档对象。 win.scroll(function () { if (sc.scrollTop() >= 100) { nav.addClass("on"); } else { nav.removeClass("on"); } }) }) $(() => { $("#c_static_001-1667897618405 .e_loop-5 .p_loopitem .e_container-6").wrapAll("
").parent().appendTo(".cn-show .saf-cn-proswiper .swiper-container"); if($(".saf-cn-proswiper").length){ var swiper = new Swiper(".saf-cn-proswiper .swiper-container", { autoplay: { delay: 5000, disableOnInteraction: false, }, loop: true, slidesPerView: 4, speed:800, spaceBetween: 30, pagination: { el: ".saf-cn-proswiper .saf-cn-pagination", }, navigation: { nextEl: ".saf-cn-proswiper .s_next", prevEl: ".saf-cn-proswiper .s_prev", }, breakpoints: { 0: { slidesPerView: 1, spaceBetween: 20 }, 768: { slidesPerView: 2, spaceBetween: 20 }, 1024: { slidesPerView: 3, spaceBetween: 20 }, 1400: { slidesPerView: 4, spaceBetween: 20 } } }); } })