$.fn.sub_banner = function(effect) { let body = $("body"); if (isFrontEnv()) { this.each(function() { // 娣诲姞缁熶竴鏍峰紡锛屾柟渚縞ss缁熶竴绠$悊 $(this).addClass("banner_text_effect"); let slide = $(this).find(".swiper-slide"); if (slide.length == 1) { $(this).addClass("no-prev-next"); } slide.first().addClass("swiper-slide-active"); // 璁剧疆鍔ㄧ敾鏁堟灉 // 濡傛灉娌℃湁浼犻€掓晥鏋滃弬鏁帮紝灏遍粯璁や负fadeIn $(this).addClass(effect || "fadeIn"); // 灏嗘枃鏈垎绂伙紝骞剁敤span鏍囩鍖呰9 $(this).find(".text-white").each(function() { // 鑾峰彇鏂囨湰 let text = $(this).text(); // 鍘绘帀宸﹀彸绌虹櫧 text = text.trim(); // 灏嗘枃鏈垎绂绘垚鏁扮粍 ["鍏?, "浜?, "鎴?, "浠?] let text_array = text.split(""); // 灏嗘瘡涓枃鏈敤span鍖呰9 let html = text_array.join(""); // 鍔犱笂澶村熬 html = "" + html + ""; // 鏇挎崲鏂囨湰 $(this).html(html); }); // 鍔ㄧ敾鏁堟灉 $(this).find("span").each(function() { if (Math.random() > 0.3) { // 璁剧疆闅忔満寤舵椂锛屽氨鏈変簡闅忔満鍑虹幇鐨勬晥鏋 $(this).css("animation-delay", (0.3 + Math.random()) + "s"); } }); }); if (!body.hasClass("front")) { setTimeout(a => { body.addClass("front"); }, 100); } } else { body.addClass("make"); } }; $.fn.auto_category = function() { let body = $("body"); if (isFrontEnv()) { this.each(function() { $(this).addClass("hide").find("a").wrapAll("
").parent().wrapAll("
").parent().insertAfter(this).find("a").wrap("
").each(function() { $(this).text($(this).text().trim()).attr("data-text", $(this).text()); if (location.href.indexOf(this.href) > -1) { setTimeout(()=>{ $(this).addClass("category-current"); }, 100); } }); }); if (!body.hasClass("front")) { setTimeout(a => { body.addClass("front"); }, 100); } } else { body.addClass("make"); } }; $(a => { // 榛樿fadeIn $("閫夋嫨鍣?).sub_banner(); $(".zw-banner").sub_banner("fadeInRight"); // 鍏朵粬鏁堟灉: fadeInUp fadeInDown fadeInLeft fadeInRight // $("#c_banner_019-1660963287521").sub_banner("fadeInRight"); $(".zw-fl").auto_category(); }); /*椤甸潰楂樹寒*/ $(".lzw-fl .e_text-5 a").each(function(){ var name = $.trim($(this).text()); var title = $.trim($(".lzw-bt .e_h1-2").text()); if(name == title){ $(this).addClass("light"); } }) /*鍒楄〃鑾峰彇鍥剧墖*/ $("#c_new_list_087-1653374527770 .e_loop-1 .p_loopitem").each(function() { if($(this).find(".e_image-3 img").length){ (function(a) { var href = a.find(".e_text-11 ").attr("href"); var sub = $("
").addClass("cn_sub"); a.find(".e_image-3").append(sub); $.get(href, function(r) { $(r).filter(".main").find("#c_new_detail_011-1642041085802 .e_richText-24").children("img").eq(0).appendTo(sub); }); })($(this)); } });