$(document).ready(function () { var sw = document.documentelement.clientwidth || window.innerwidth || document.clientwidth; var k = 0; var mb = mybrowser(); function mybrowser() { var useragent = navigator.useragent; //取得浏览器的useragent字符串 var isopera = useragent.indexof("opera") > -1; if (isopera) { return "opera" }; //判断是否opera浏览器 if (useragent.indexof("firefox") > -1) { return "ff"; } //判断是否firefox浏览器 if (useragent.indexof("edge") > -1) { return "edge"; } if (useragent.indexof("chrome") > -1) { return "chrome"; } if (useragent.indexof("safari") > -1) { return "safari"; } //判断是否safari浏览器 if (useragent.indexof("compatible") > -1 && useragent.indexof("msie") > -1 && !isopera) { return "ie"; }; //判断是否ie浏览器 } /*==========*/ $('.tem_head .tm_tnav').on('click', function () { k++; if (k % 2 == 1) { $('.tem_head nav').animate({ height: '248px' }); $('.bb').css("border-width", "1px"); } else { $('.tem_head nav').animate({ height: '0px' }); $('.bb').css("border-width", "0"); }; }) /*公司简介淡入*/ var li_top = 0; var scroll_top = document.documentelement.scrolltop || window.pageyoffset || document.body.scrolltop; var height_top = $(window).height(); var dl_length = $(".siderbar3 .tmlc_content ul li").length; $(window).scroll(function () { scroll_top = document.documentelement.scrolltop || window.pageyoffset || document.body.scrolltop; height_top = $(window).height(); for (var i = 0; i < dl_length; i++) { li_top = $(".siderbar3 .tmlc_content ul").find("li.lc_content" + i).offset().top; var aa = scroll_top + height_top; if (scroll_top + height_top > li_top + 100) { $(".siderbar3 .tmlc_content ul").find("li.lc_content" + i).addclass("on"); } } }) /*荣誉*/ var itemlen0 = $(".tm_ry ul li").length; if (sw < 400) { $('.ry_click .ry_click_right').click(function () { $(".tm_ry ul").animate({ marginleft: "-320px" }, 360, function () { $(".tm_ry ul>li").eq(0).appendto($(".tm_ry ul")); $(".tm_ry ul").stop(200).css('marginleft', '0px'); }); }) $('.ry_click .ry_click_left').click(function () { $(".tm_ry ul").css('marginleft', '-320px'); $(".tm_ry ul>li").eq(itemlen0 - 1).prependto($(".tm_ry ul")); $(".tm_ry ul").stop(200).animate({ marginleft: "0px" }, 360); }) } else { $('.ry_click .ry_click_right').click(function () { $(".tm_ry ul").animate({ marginleft: "-393px" }, 360, function () { $(".tm_ry ul>li").eq(0).appendto($(".tm_ry ul")); $(".tm_ry ul").stop(200).css('marginleft', '0px'); }); }) $('.ry_click .ry_click_left').click(function () { $(".tm_ry ul").css('marginleft', '-393px'); $(".tm_ry ul>li").eq(itemlen0 - 1).prependto($(".tm_ry ul")); $(".tm_ry ul").stop(200).animate({ marginleft: "0px" }, 360); }) } $("#mynav").affix({ offset: { top: 660 } }); $('body').scrollspy({ target: '.tmscroll' }); $('.tm_zf .zf_tit ul li').eq(0).addclass('on'); $('.tm_zf .zf_tit ul li').click(function () { $(this).addclass('on').siblings().removeclass('on'); }) /*生成与制造*/ var itemlen1 = $(".tm_sc_one1 .tm_sc_list ul li").length; $('.tm_sc_one1 .click2').click(function () { if (sw < 420) { $(".tm_sc_one1 .tm_sc_list ul").animate({ marginleft: "-300px" }, 360, function () { $(".tm_sc_one1 .tm_sc_list ul.list_sc li").eq(0).appendto($(".tm_sc_one1 .tm_sc_list ul")); $(".tm_sc_one1 .tm_sc_list ul").stop(200).css('marginleft', '0px'); }); } else { $(".tm_sc_one1 .tm_sc_list ul").animate({ marginleft: "-386px" }, 360, function () { $(".tm_sc_one1 .tm_sc_list ul.list_sc li").eq(0).appendto($(".tm_sc_one1 .tm_sc_list ul")); $(".tm_sc_one1 .tm_sc_list ul").stop(200).css('marginleft', '0px'); }); } }) $('.tm_sc_one1 .click1').click(function () { if (sw < 420) { $(".tm_sc_one1 .tm_sc_list ul").css('marginleft', '-300px'); } else { $(".tm_sc_one1 .tm_sc_list ul").css('marginleft', '-386px'); } $(".tm_sc_one1 .tm_sc_list ul>li").eq(itemlen1 - 1).prependto($(".tm_sc_one1 .tm_sc_list ul")); $(".tm_sc_one1 .tm_sc_list ul").stop(200).animate({ marginleft: "0px" }, 360); }) var itemlen2 = $(".tm_sc_one2 .tm_sc_list ul li").length; $('.tm_sc_one2 .click4').click(function () { if (sw < 420) { $(".tm_sc_one2 .tm_sc_list ul").animate({ marginleft: "-300px" }, 360, function () { $(".tm_sc_one2 .tm_sc_list ul.list_sc li").eq(0).appendto($(".tm_sc_one2 .tm_sc_list ul")); $(".tm_sc_one2 .tm_sc_list ul").stop(200).css('marginleft', '0px'); }); } else { $(".tm_sc_one2 .tm_sc_list ul").animate({ marginleft: "-386px" }, 360, function () { $(".tm_sc_one2 .tm_sc_list ul.list_sc li").eq(0).appendto($(".tm_sc_one2 .tm_sc_list ul")); $(".tm_sc_one2 .tm_sc_list ul").stop(200).css('marginleft', '0px'); }); } }) $('.tm_sc_one2 .click3').click(function () { if (sw < 420) { $(".tm_sc_one2 .tm_sc_list ul").css('marginleft', '-300px'); } else { $(".tm_sc_one2 .tm_sc_list ul").css('marginleft', '-386px'); } $(".tm_sc_one2 .tm_sc_list ul>li").eq(itemlen2 - 1).prependto($(".tm_sc_one2 .tm_sc_list ul")); $(".tm_sc_one2 .tm_sc_list ul").stop(200).animate({ marginleft: "0px" }, 360); }) /*职位搜索*/ $('.sear_job .sear_list .list ul li').on('click', function () { $(this).addclass("laji").siblings().removeclass("laji"); $(this).css('color', '#cc0000').siblings().css('color', '#333'); var licon = $(this).text(); var liclass = $(this).attr("class"); var lajiarr = new array(); var index = 0; $(".laji").each(function () { lajiarr[index] = $(this).attr("vall"); index++; }) console.log(lajiarr); $('.tm_job ul.list_1 li').each(function () { var stra = new array(); var str; var len = $(this).children().length; for (var i = 0; i < len; i++) { var con_para = $(this).children().eq(i).attr("para"); var str = $(this).children().eq(i).text(); if (!str) { str = $(this).children().eq(i).val(); } stra[i] = str; } if (iscontained(stra, lajiarr)) { $(this).css('display', 'block'); } else { $(this).css('display', 'none'); }; }) }) $('.sear_job .sear_list .list ul li').eq(0).on("click", function () { $('.tm_job ul.list_1 li').css('display', 'block'); }) function iscontained(a, b) { if (!(a instanceof array) || !(b instanceof array)) return false; if (a.length < b.length) return false; var astr = a.tostring(); console.info(astr); for (var i = 0, len = b.length; i < len; i++) { if (astr.indexof(b[i]) == -1) return false; } return true; } var sa = $('.met_tools .met_page .met_page_preinfo a:first-child').attr('title'); var sa2 = $('.met_tools .met_page .met_page_next a:last-child').attr('title'); var s = "没有了"; if (sa == s) { $('.met_tools .met_page .met_page_preinfo a').removeattr('href'); }; if (sa2 == s) { $('.met_tools .met_page .met_page_next a').removeattr('href'); }; $('#sitemaplist dl').eq(1).css('display', 'none'); $('#sitemaplist dl').eq(2).css('display', 'none'); $('#sitemaplist dl').eq(3).css('display', 'none'); $('.msgmodal .back').click(function () { $('.msgmodal').removeclass('act'); }) $('.msga').click(function () { $('#msgmodal1').addclass('act'); }) if($('#msgmodal1').length>0&&location.hash=='#message'){ $('#msgmodal1').addclass('act'); } let winwidth = window.innerwidth; $(window).resize(function () { winwidth = window.innerwidth }) function setlihover() { $('.siderbar3 .picture li').mouseenter(function () { if (winwidth >= 1280) { $(this).css('width', '500px').siblings().css({ 'width': '225px', 'transition': '.5s' }) } }) $('.siderbar3 .picture li').mouseleave(function () { if (winwidth >= 1280) { $(this).css({ 'width': '295px', 'transition': '.5s' }) $(this).siblings().css({ 'width': '295px', 'transition': '.5s' }) } }) } var formsubmithandle = false; $(".htbtforminfo").on("submit", function (e) { //阻止默认行为 e.preventdefault(); if (formsubmithandle) { return false; } formsubmithandle = true; var formdata = $(this).serializearray(); var senddata = {} for (var i = 0; i < formdata.length; i++) { if (!formdata[i].value) { alert('表单内容不能为空') return; } senddata[formdata[i].name] = formdata[i].value } var _this = $(this)[0]; $.ajax({ type: 'post', url: $(this).attr('action'), data: senddata, success: function () { _this.reset(); alert('提交成功') formsubmithandle = false; }, error: function (error) { console.log(error) alert('提交失败') formsubmithandle = false; } }); }) setlihover() $('.tem_wp2,.tem_wp4').css({ 'animation-delay': function () { return $(this).index() * 0.3 + 's' }, '-webkit-animation-delay': function () { return $(this).index() * 0.3 + 's' } }); if ($(".tem_index_about").length > 0) { var times2; $(".tem_index_about_img ol li").hover(function () { var m = $(this); times2 = settimeout(function () { $(".tem_index_about_img ul li").hide(); $(".tem_index_about_img ol li").removeclass("tem_now"); $(".tem_index_about_img ul li").eq(m.index()).show(); m.addclass("tem_now") }, 300) }, function () { cleartimeout(times2) }) } if ($(".tem_index_product").length > 0) { var minwidth = parseint($('.tem_index_product ul').attr("data-product_x")) + 20; $(".tem_index_product ul li a").width($('.tem_index_product ul').attr("data-product_x")); } var tem_news = $(".tem_index_news"), tem_case = $(".tem_index_case"); if (tem_case.length > 0 || tem_news.length > 0) { if (tem_case.length > 0) { var img = $('.tem_index_case_list .tem_list dt img'); $('.tem_index_case_list .tem_list dt a').css({ "width": img.attr('width'), "height": img.attr('height') }); $('.tem_index_case_list .tem_list dd h3').css({ "width": img.attr('width') }); } } $('.aboutnav').find('a').each(function(e){ if(location.pathname==$(this).attr('href')) { $(this).parents('.inblk').addclass('on') } }) })