document.write(''); $(function() { $('.getTop').hide(); //搜索效果 $(".lan_en").click(function(){ $('.tsearch').toggleClass('active'); if ($('.tsearch').hasClass('active')) { $(this).find('span').removeClass('icon-search').addClass('icon-close'); } else { $(this).find('span').removeClass('icon-close').addClass('icon-search'); } }); //产品切换 $('.index-products .pro_switch li').hover(function() { var that = this $('.index-products .pro_switch li').removeClass('active') $(this).addClass('active') $(".index-products .pro_content .pro_w").each(function(){ if ($(this).attr('data-tab') == $(that).attr('data-tab')){ $(this).addClass('active') } else { $(this).removeClass('active') } }) }) //案例效果 $('.index-project .ht_switch .hts_item').hover(function() { var that = this $('.index-project .ht_switch .hts_item').removeClass('active') $(this).addClass('active') $(".index-project .ht_content .ht_w").each(function(){ if ($(this).attr('data-tab') == $(that).attr('data-tab')){ $(this).addClass('active') } else { $(this).removeClass('active') } }) }) //场景图片切换 $('.smart_three .scene-list .scene-item').click(function() { var that = this $('.smart_three .scene-list .scene-item').removeClass('active') $(this).addClass('active') $(".smart_three .scene-img").each(function(){ if ($(this).attr('data-tab') == $(that).attr('data-tab')){ $(this).addClass('active') } else { $(this).removeClass('active') } }) }) //解决方案切换 $('.pxt div').click(function() { var that = this $('.pxt div').removeClass('active') $(this).addClass('active') $(".pxt_content .pxt_wu").each(function(){ if ($(this).attr('data-tab') == $(that).attr('data-tab')){ $(this).addClass('active') } else { $(this).removeClass('active') } }) }) //产品缩略图 $('.products-img-list .products-img-item').click(function() { $('.products-img-list .products-img-item').removeClass('active') $('.products-color-list a').removeClass('active') $('.products-material-list a').removeClass('active') $(this).addClass('active') $('#current-img').attr('src',$(this).find("img").attr('data-src')) }) $('.products-color-list a').click(function() { var that = this $('.products-color-list a').removeClass('active') $('.products-material-list a').removeClass('active') $(this).addClass('active') console.log($(this).find("img").attr('data-src')) $('#current-img').attr('src',$(this).attr('data-src')) }) $('.products-material-list a').click(function() { var that = this $('.products-material-list a').removeClass('active') $('.products-color-list a').removeClass('active') $(this).addClass('active') console.log($(this).find("img").attr('data-src')) $('#current-img').attr('src',$(this).attr('data-src')) }) $('.ps_header').on('click', function () { var catelog = $('.ps_catelog') if (catelog.hasClass('catelog_active')) { catelog.removeClass('catelog_active'); catelog.stop(true, true).slideUp() $('.ps_mask').fadeOut() $('.ps_header span').removeClass('active') $('body').css('overflow', '') } else { catelog.addClass('catelog_active'); catelog.stop(true, true).slideDown() $('.ps_mask').fadeIn() $('.ps_header span').addClass('active') $('body').css('overflow', 'hidden') } }); var w = $('.wrapper').width(); var ww = $(window).width(); $(window).scroll(function(){ var st = $(document).scrollTop(); if(st > 71){ $(".go_baoming").addClass("fixtop"); }else{ $(".go_baoming").removeClass("fixtop"); } if(st > 400){ $('.getTop').fadeIn(300); }else{ $('.getTop').fadeOut(300); } }); $(".getTop").click(function() { $("html,body").animate({ scrollTop: '0' }, 500); return false; }) $(".m-navbth a").on("click", function(e) { var s = $("header .nav_box"); s.hasClass("nav_show") ? (s.removeClass("nav_show"), $(".m-navbth .menu_top").removeClass("menu_top_r").stop(!0, !0).animate({ top: "2px" }, 500), $(".m-navbth .menu_mid").removeClass("menu_mid_r"), $(".m-navbth .menu_bot").removeClass("menu_bot_r").stop(!0, !0).animate({ top: "16px" }, 500)) : (s.addClass("nav_show"), $(".m-navbth .menu_top").addClass("menu_top_r").stop(!0, !0).animate({ top: "9px" }, 500), $(".m-navbth .menu_mid").addClass("menu_mid_r"), $(".m-navbth .menu_bot").addClass("menu_bot_r").stop(!0, !0).animate({ top: "9px" }, 500)), e.stopPropagation() }); $('.head-nav h3.title .jtt').on('click',function(){ var parent = $(this).parent().parent().parent();//获取当前页签的父级的父级 if($(this).parent().parent().hasClass('open') == false) { //展开未展开 parent.find(".link-list").removeClass('active'); parent.find(".nav_item").removeClass("open") $(this).parent().parent(".nav_item").addClass("open").find(".link-list").addClass('active'); }else{ $(this).parent().parent(".nav_item").removeClass("open").find(".link-list").removeClass('active'); } }) $(".foot_menu .f_menu_box > li > a").click(function() { $(this).parent().siblings().children(".f_sub_menu").stop(!0, !0).slideUp(), $(this).parent().siblings().children(".f_sub_menu").removeClass("f_show"), $(this).parent().siblings().children("a").children("span").removeClass("active"); var e = $(this).siblings(".f_sub_menu"); e.hasClass("f_show") ? (e.stop(!0, !0).slideUp(), $(this).children("span").removeClass("active"), e.removeClass("f_show")) : (e.addClass("f_show"), $(this).children("span").addClass("active"), e.stop(!0, !0).slideDown()) }) }); function checkDownloadGuestbook() { var email = $('input[name=oemail]'); var yourname = $('input[name=oyourname]'); var phone = $('input[name=ophone]'); var address = $('input[name=oaddress]'); var id = $('input[name=id]'); var zlx = $('input[name=zlx]'); var company = $('input[name=ocompany]'); var message = $('textarea[name=omessage]'); if (yourname.val() == '') { layer.msg('请输入您的姓名!'); yourname.focus(); return false; } if (phone.val() == '') { layer.msg('请输入您的电话号码!'); phone.focus(); return false; } if (email.val() == '') { layer.msg('请输入您的邮箱地址!'); email.focus(); return false; } if (!checkMail(email.val())) { layer.msg('请输入一个正确的邮箱地址!'); email.focus(); return false; } if (address.val() == '') { layer.msg('请输入联系地址!'); address.focus(); return false; } value = $("#overcode").val(); if (value == '') { layer.msg('请输入验证码!'); $("#overcode").focus(); return false; } if (dyfrom_ajax("/index.php?c=ajax&a=vercode", "vercode=" + value) == 'false') { layer.msg('请输入正确的验证码!'); $("#overcode").focus(); return false; } $.ajax({ type: "POST", dataType: "JSON", url: "/index.php?c=message&a=add", async: false, cache: false, data: { lx: 4, title: '下载消息验证', yourname: yourname.val(), id: id.val(), zlx: zlx.val(), phone: phone.val(), email: email.val(), address: address.val(), company: company.val(), message: message.val(), vercode: value }, success: function(msg) { layer.msg(msg.des); if (msg.state == 'success') { $('#dgb input[type=text],#dgb textarea').val(''); window.location.href=msg.url; } } }); return true; } function openGbook(ntitle,zlx,id) { var w = $(window).width(); if (w < 580) { wd = w * 0.95; } else { wd = 580; } layer.open({ type: 1, title: ntitle, skin: 'layui-layer-demo', //样式类名 closeBtn: 1, //不显示关闭按钮 anim: 2, area: wd + 'px', shadeClose: true, //开启遮罩关闭 content: '