//pc下拉 var $i; var $flag = false; $(".sub").hover(function () { $flag = true; }, function () { $(".sub[data-m='" + $i + "']").slideUp(); $(".menu .nli a[data-n='" + $i + "']").parent().parent().removeClass("active"); $flag = false; }); $(".menu .nli span a").hoverIntent(function () { $i = $(this).attr("data-n"); $(".sub[data-m='" + $i + "']").slideDown(); $(this).parent().parent().addClass("active"); }, function () { if (!$flag) { $(".sub[data-m='" + $i + "']").slideUp(); $(this).parent().parent().removeClass("active"); } }); // 菜单下拉 $(".menuph").click(function () { $(this).find(".point").toggleClass("active"); $(".xialaph").slideToggle(); $(".phonemeng").toggleClass('active'); $("body,html").animate({ //scrollTop:0 }, 500); }); $(".xialaph h4").click(function () { $(this).siblings(".ul2").slideToggle(); $(this).parent().siblings().find(".ul2,.ul3").slideUp(); $(this).toggleClass("active"); $(this).parent().siblings().find("h4,h5").removeClass('active'); }); $(".xialaph h5").click(function () { $(this).siblings(".ul3").slideToggle(); $(this).parent().siblings().find(".ul3").slideUp(); $(this).toggleClass("active"); $(this).parent().siblings().find("h4,h5").removeClass('active'); }); $(".xialaph .lian h5").click(function () { $(this).siblings().toggleClass('active'); }); // 侧悬浮 $(".cxf .renter").on("click", function () { $('body,html').animate({ scrollTop: 0 }); }) $(".cxf .box1").hoverIntent(function () { if ($(this).offset().left > $(window).width() - $(this).offset().left) { $(this).find(".con").show(0, function () { $(this).addClass("rtl"); }); } else { $(".cxf .ctext .box .box1 .phone").addClass("phone1"); $(".cxf .ctext .box .box1 .ewm").addClass("ewm1"); $(this).find(".con").show(0, function () { $(this).addClass("ltr"); }); } }, function () { $(this).find(".con").fadeOut(200, function () { $(this).removeClass("rtl"); $(this).removeClass("ltr"); }); }); //返回顶部 $(".renter").on("click", function () { $('body,html').animate({ scrollTop: 0 }); }) if ($(window).width() < 991) { $('.wyb_s').click(function(){ $('body').toggleClass('on'); }); } // 20211016start新增 // function handleScreen(){ // const m = detectZoom(); // document.body.style.zoom = 100/Number(m); // } // function detectZoom () { // let ratio = 0, // screen = window.screen, // ua = navigator.userAgent.toLowerCase(); // if (window.devicePixelRatio !== undefined) { // ratio = window.devicePixelRatio; // } else if (~ua.indexOf('msie')) { // if (screen.deviceXDPI && screen.logicalXDPI) { // ratio = screen.deviceXDPI / screen.logicalXDPI; // } // } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) { // ratio = window.outerWidth / window.innerWidth; // } // if (ratio) { // ratio = Math.round(ratio * 100); // } // return ratio; // } // window.onresize = function(){ // handleScreen() // } // 20211016end新增 //wow $(function() { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, //距离可视区域多少开始执行动画 mobile: false, //是否在移动设备上执行动画 live: true, //异步加载的内容是否有效 }); wow.init(); });