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') } }) }) //瑙e喅鏂规鍒囨崲 $('.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: '