/*------------------- *Description: By www.yiwuku.com *Website: https://app.zblogcn.com/?id=27605 *Author: 尔今 erx@qq.com *update: 2021-12-22(Last:2023-03-20) -------------------*/ $(function() { //erx:Navbar var erxUrl = location.href, erxRecs = 0, erxRecTimer; $(".erx-menu > li > a").each(function() { if (this.href == erxUrl.toString().split("#")[0]) { $(this).parent().addClass("cu"); return false; } }); $(".erx-menu > li:has('ul')").each(function() { $(this).children("a").append(""); }); $(".erx-menu > li:has('ul')").mouseenter(function(){ $(this).addClass("cu").children("ul").stop(true, true).delay(50).fadeIn(erxIsmobile()?0:200); }).mouseleave(function(){ $(this).removeClass("cu").children("ul").stop(true, true).delay(50).hide(0); }); $('.erx-mb-nav-ctrl').click(function(){ $(".erx-menu").toggleClass("active"); }); $(document).bind("click",function(e){ if($('.erx-mb-nav-ctrl').is(":visible") && !$(e.target).closest(".erx-mb-nav-ctrl").length && !$(e.target).closest(".erx-menu").length){ $(".erx-menu").removeClass("active"); } }); //Mobile $(window).resize(function(){ erxAppMobileNav(); }); function erxAppMobileNav(){ if(erxIsmobile()){ $(".erx-menu>li:has(ul)").each(function(){ $(this).attr("data-minav", 0); }); }else{ $(".erx-menu>li:has(ul)").removeAttr("data-minav"); $(".erx-search-form .sint").focus(function(){ $(".erx-menu").addClass("blur"); }).blur(function(){ $(".erx-menu").removeClass("blur"); }); } } erxAppMobileNav(); $(".erx-menu > li:has('ul') > a").click(function(){ var minav = $(this).parent().attr("data-minav")*1; if(!minav && erxIsmobile()){ $(this).parent().attr("data-minav", 1).siblings().attr("data-minav", 0); return false; } }); //erx:Home $(".erx-rec-ctrl span").click(function(){ let i = $(this).index(); $(this).addClass("cu").siblings().removeClass("cu"); $(".erx-rec-list").children("ul:eq("+i+")").addClass("erx-flex").siblings().removeClass("erx-flex"); clearInterval(erxRecTimer); }); $(".erx-m-tit .f .cu").each(function(){ let $s = $(this), i = $s.index(), $p = $s.parents('.erx-m-tit'); $p.next().children().eq(i).addClass("erx-flex").siblings().removeClass("erx-flex"); }); $(".erx-m-tit .f a").click(function(){ let $s = $(this), i = $s.index(), $p = $s.parents('.erx-m-tit'); $p.next().children().eq(i).addClass("erx-flex").siblings().removeClass("erx-flex"); $s.addClass("cu").siblings().removeClass("cu"); }); erxRecShow(); function erxRecShow(){ erxRecs += 1; erxRecs == $(".erx-rec-list ul").length ? erxRecs = 0 : ''; setTimeout(function(){ $(".erx-rec-list").children("ul:eq("+erxRecs+")").addClass("erx-flex").siblings("ul").removeClass("erx-flex"); $(".erx-rec-ctrl").children("span:eq("+erxRecs+")").addClass("cu").siblings().removeClass("cu"); erxRecShow(); }, 12000); } //erx:Gotop $(".erx-gotop").click(function(){ $("html, body").animate({ scrollTop: 0 },300); return false; }); var erxSctop = $(window).scrollTop(), erxSnum = 500; if(erxSctop > erxSnum){ $(".erx-gotop").addClass("active"); } $(window).scroll(function(){ erxSctop = $(window).scrollTop(); if(erxSctop > erxSnum){ $(".erx-gotop").addClass("active"); }else{ $(".erx-gotop").removeClass("active"); } }); //erx:Swiper-Home if($(".erx-home-swiper").length){ var swiper = new Swiper(".erx-home-swiper", { loop : true, autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: true, }, pagination: { el: ".swiper-pagination", clickable :true, }, }); } //erx:Swiper-App if($(".erx-app-swiper").length){ var swiper = new Swiper(".erx-app-swiper", { slidesPerView: $(".erx-app-swiper").hasClass("vertical-mode")?3.5:1.2, spaceBetween: 20, pagination: { el: ".swiper-pagination", type: "fraction", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, }); } $(".erx-app-items .must-login").click(function(){ alert("\u8bf7\u5148\u767b\u5f55\uff01"); return false; }); $(".erx-article .con img").each(function(){ let $self = $(this), path = $self.attr("src"); if(!$self.parent("a").length){ $self.wrap(''); } }); if($.isFunction($.fn.lightGallery)) { $(".erx-app-swiper, .erx-article .con").lightGallery({ selector: '.erx-lg-item' }); } //erx:Qrcode if($(".erx-app-qr .q").length){ $.getScript(bloghost+"zb_users/theme/erx_App/script/jquery-qrcode.min.js",function() { $(".erx-app-qr .q").qrcode({ text:erxUrl, size:90 }).parent().addClass("erx-show"); }); } //erx:Sidebar if($(window).width()>1080){ $('.erx-sidebar').theiaStickySidebar({ additionalMarginTop: 20 }); } function erxIsmobile(){ var pwt = $(window).width(); if (pwt < 1080 || /Android|Windows Phone|iPhone|iPod/i.test(navigator.userAgent)) { return true; }else{ return false; } } }); if(window.console && window.console.log){ console.log('\n %c Z-Blog erx_App %c \u5c14\u4eca\u4f5c\u54c1 \n', 'color:#fff;background:#f80;padding:5px 0;', 'color:#fff;background:#333;padding:5px 0;'); console.log("%c \x68\x74\x74\x70\x73\x3a\x2f\x2f\x61\x70\x70\x2e\x7a\x62\x6c\x6f\x67\x63\x6e\x2e\x63\x6f\x6d\x2f\x3f\x69\x64\x3d\x32\x37\x36\x30\x35", ""); } //erx:Comments zbp.plugin.unbind("comment.reply.start", "system"); zbp.plugin.on("comment.reply.start", "erx_App", function(id) { var i = id; $("#inpRevID").val(i); var frm = $('#divCommentPost'), cancel = $("#cancel-reply"); if (!frm.hasClass("reply-frm")){ frm.before($("