//顶部导航 fnheader(); /*页面滚动头部动画*/ function fnheader() { $(window).scroll(function() { var currTop = $(window).scrollTop(); if (currTop < 35) { $('.header').removeClass('header-scroll'); } else { $('.header').addClass('header-scroll'); } }); if ($(window).scrollTop() > 0) { $('.header').addClass('header-scroll'); } } function meun_btn() { $(".meun-btn").toggleClass("meun-btn-open"); $(".mobile-nav-box").toggleClass("mobile-nav-box-show"); // $("html, body").toggleClass("height100"); $(".wrapper").toggleClass("wrapper-after-show"); } $(".mobile-meun-nav ul li .tit").click(function() { $(this).children("i").toggleClass("icon-angle-down").toggleClass("icon-angle-up").parents("li").siblings().find("i").removeClass("icon-angle-up").addClass("icon-angle-down"); $(this).next(".mobile-second-nav").slideToggle().parent().siblings().find(".mobile-second-nav").slideUp(); $(this).toggleClass("chose").parent().siblings().find(".tit").removeClass("chose"); }) // 首页产品弹出 $(function() { $('.imgSrcBox .prod_img').on('mouseover', function() { $(this).parent('.imgSrcBox').find('.prod-big-pic').show() }); $('.imgSrcBox .prod_img').on('mouseout', function() { $(this).parent('.imgSrcBox').find('.prod-big-pic').hide() }); $('.imgSrcBox .prod_img').on('click', function() { let p_link = $('this').html() //.attr('href-data') console.log(p_link); return; window.location.href = p_link; }) //多页隐藏 var num = $(".p_page").find("a.page_num").length; if (num = 1) { $(".p_page").addClass("hide"); } }) //荣誉切换 var ms = $(".honoRBoxBB"); if (ms.length > 0){ var honoRBox = new Swiper('.honoRBoxBB', { slidesPerView: 1, spaceBetween: 20, watchSlidesVisibility: true, centerInsufficientSlides: true, navigation: { nextEl: '.honoRBoxBB .swiper-button-next', prevEl: '.honoRBoxBB .swiper-button-prev', }, breakpoints: { 768: { slidesPerView: 4, spaceBetween: 25 } } }) } //案例图片放大 $(function(){ 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({}); } } }) //内页分类效果 // 获取 屏幕宽度 var domWith = $(document).width(); // console.log(domWith); var href = location.pathname + location.search; // let href = $('.p_breadcrumbList .contentBox:last a').attr('href') //if (!href) return; $(".content .p_linkBox .yjLink").each(function(i, e) { var aa = $(e).attr("href"); if (aa == href) { // 自身样式 $(e).parents('li.p_linkBox').addClass('light') .end().siblings('li').removeClass('light'); } }); if (domWith > 768) { // 三级显示 $('.ejLi').hover(function() { // 图标 转向 $(this).find('.iconfont2').addClass('icf').end() .find('.sjBox').show(); }, function() { // 图标复原 $(this).find('.iconfont2').removeClass('icf').end() .find('.sjBox').hide(); }) } else { // 移动端 点击出现 $('.moveBtn').on('click', function() { // 按钮隐藏 $(this).css({ 'opacity': 0 }, 500) // 内容滑出 $('.contentBox').animate({ "left": 0 }, 500) }) // 移动端 点击收回 $('.backBtn').on('click', function() { // 按钮显示 $('.moveBtn').css({ 'opacity': 1 }, 500) // 内容收回 $('.contentBox').animate({ "left": "100%" }, 500) }) // 移动端二级 点击事件 $('.iconfont2').on('click', function() { // 蓝线的显示与隐藏 $(this).siblings('.line_right').toggleClass('line_show'); // 自身 三级下拉 ,其它的隐藏 $(this).toggleClass('jsDeg') .parents('.ejLi').find('.sjBox').slideToggle().end() .siblings('.ejLi').find('.sjBox').slideUp() .end().find('.iconfont2').removeClass('jsDeg'); }) } //在线客服 $(function() { $('.blacktop').click(function() { $('html , body').animate({ scrollTop: 0 }, 'slow'); }); $(".wyz-in:not(.wyz-search)").on("mouseenter", function() { $(this).addClass("cur").siblings(".wyz-in").removeClass("cur"); }).on("mouseleave", function() { $(this).removeClass("cur"); }); $(".cf-close").on("click", function() { $(this).parents(".wyz-search").removeClass("cur"); $(this).parents(".wyz-form").removeClass("cur"); }); $(".wyz-wx").on("mouseenter", function() { $(this).addClass("cur").siblings(".wyz-in").removeClass("cur"); setTimeout(function() { if ($(".wyz-wx").hasClass("cur")) { $(".wyz-qr-show").fadeIn("fast"); } }, 600); }).on("mouseleave", function() { $(this).removeClass("cur"); $(".wyz-qr-show").fadeOut("fast"); }); $(".wyz-dy").on("mouseenter", function() { $(this).addClass("cur").siblings(".wyz-in").removeClass("cur"); setTimeout(function() { if ($(".wyz-dy").hasClass("cur")) { $(".wyz-dy-show").fadeIn("fast"); } }, 600); }).on("mouseleave", function() { $(this).removeClass("cur"); $(".wyz-dy-show").fadeOut("fast"); }); $(window).on("load scroll", function() { var top = $(document).scrollTop(), wHeight = $(window).height(); if (top > wHeight) { $(".wyz-top").fadeIn("fast"); $(".wyz").css({ "height": 1 }); } else { $(".wyz-top").hide(); $(".wyz").removeAttr("style"); } }); $(".wyz-top").on("click", function() { $("html,body").stop().animate({ scrollTop: 0 }, 500); }); }) //荣誉弹窗 $(document).ready(function() { $('#c_static_001-1640681729466 .p_loopitem').on('click', '.cbox-6-0', function() { let img_src = $(this).find('img').attr("src") let img_name = $(this).find('.e_text-5').text() console.log(img_name) $('.pro-swiper-box').addClass('show-swiper'); $('.pro-swiper-box .proImg-pc').attr('src', img_src); $(".proLink-swiper").text(img_name) var list_index = $(this).index() + 1; }); $('.close-box').on('click', function() { $('.pro-swiper-box').removeClass('show-swiper'); }); $('.pro-swiper-box').on('click', function() { $('.pro-swiper-box').removeClass('show-swiper'); }); }); $(function() { if (isFrontEnv()) { //面包屑补丁 $('.p_breadcrumb .p_breadcrumbItem').each(() => { let a = $(this).find('a').attr('href'); if (a == 'undefined') { $(this).hide() } }) //文字打散 $.fn.shan_dong=function(){ this.each(function() { $(this).html("" + $(this).text().trim().split("").join("") + ""); $(this).find("span").each(function() { if (Math.random() > 0.5) { $(this).css("transition-delay", Math.random() + "s"); } }); }); } $.fn.shun_dong=function(){ let a = this a.each(function() { $(this).html("" + $(this).text().trim().split("").join("") + ""); $(this).find("span").each(function(i) { setTimeout(function(){//定时器加延时 console.log( a.find("span").text()) a.find("span").addClass('show') },2000+100*i); }); }); } $("#c_static_538-16567534404320 .e_container-1 .e_h2-19").shun_dong() $("#c_static_001-1645253205640 .e_text-2 ,#c_static_538-16567534404320 .e_container-1 .e_h3-20").shan_dong() } });