function getOperatingSystem() { var u = window.navigator.userAgent; var platform = window.navigator.platform; var isWin = (platform == "Win32") || (platform == "Windows"); var isMac = (platform == "Mac68K") || (platform == "MacPPC") || (platform == "Macintosh") || (platform == "MacIntel"); if (!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) { return 'isiOS' } else if (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1 || u.indexOf('XiaoMi') > -1) { return 'isAndroid' } else if (isWin) { return 'isWin' } else if (isMac) { return 'isMac' } } function weixinTip(ele) { var ua = navigator.userAgent; var isWeixin = !!/MicroMessenger/i.test(ua); if (isWeixin) { ele.onclick = function(e) { window.event ? window.event.returnValue = false : e.preventDefault(); document.getElementById('JweixinTip').style.display = 'block'; } document.getElementById('JweixinTip').onclick = function() { this.style.display = 'none'; } } else { ele.onclick = function(e) { if (!!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) && ua.indexOf("Safari") < 0) { alert("请使用Safari浏览器访问,谢谢"); return false; } } } } function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } var ops = getOperatingSystem(); if (ops == "isiOS" || ops == "isAndroid") { var pxUnit = 12; // 在px2rem中预设rem的值 即 1rem = ? px var designWid = 750; // 设计稿宽度 var winWid = document.body.clientWidth; var winHei = document.body.clientHeight; var bl = winWid / designWid; document.querySelector('html').style.fontSize = (bl * pxUnit) + 'px'; } jQuery(document).ready(function($) { // $('.tab-card a').simpleLightbox(); $(".tab-list ul li").each(function() { $(this).click(function() { if (!$(this).hasClass('active')) { var id = $(this).attr("data-id") $(".tab-card").hide(); $(".tab-other").fadeOut('fast'); $(".tab-" + id).each(function() { $(this).show(); }); $(".tab-list ul li").removeClass("active"); $(this).addClass("active"); } }) }); $(".steps").click(function() { $(".dynamic-content").show(); var id = $(this).attr("data-id"); $(".detail").hide(); $("#step-text-" + id).show(); }); $(".dynamic-content .close").click(function() { $(".dynamic-content").hide(); }); $("#proMenu").toggle(function() { $("#product-menu").slideDown(); }, function() { $("#product-menu").slideUp(); }); // $("#p-proMenu").toggle(function() { // console.log('11111'); // $("#p-product-menu").slideDown(); // $("#p-proMenu a").addClass("rotate"); // }, function() { // $("#p-product-menu").slideUp(); // $("#p-proMenu a").removeClass("rotate"); // }); $("#p-proMenu").on('click',function(){ if($("#p-proMenu a").hasClass('rotate')){ $("#p-product-menu").slideUp(); $("#p-proMenu a").removeClass("rotate"); }else{ $("#p-product-menu").slideDown(); $("#p-proMenu a").addClass("rotate"); } }); $(".search-hint").click(function() { $(this).hide(); $('.nav-search-form').show(); }); // $('.nav-search-field').blur(function() { // $(".search-hint").show(); // $('.nav-search-form').hide(); // }); $("form[class='nav-search-form']").submit(function() { if ($(".nav-search-field").val().trim() == '') { alert("请输入搜索的内容"); return false; } }); $("#p-show-list").toggle(function() { $(this).addClass('menuActive'); $(".p-list").slideDown(); }, function() { $(this).removeClass('menuActive'); $(".p-list").slideUp(); // 收起产品与列表 $("#p-product-menu").slideUp(); $("#p-proMenu a").removeClass("rotate"); }); //常见问题 $(".category").toggle(function() { $(this).parent().find(".faq").slideDown(); $(this).find(".txt").addClass("open"); }, function() { $(this).parent().find(".faq").slideUp(); $(this).find(".txt").removeClass("open"); }); //联系我们 $("#country-input").toggle(function() { $("#country-list").slideDown(); }, function() { $("#country-list").slideUp(); }); $(".subsc").click(function() { $(".subscribe-wrap .tnp-email").val(''); $(".modal-bg").show(); $(".subs-pop").show(); }); $(".subs-pop .menu .close").click(function() { $(".modal-bg").hide(); $(".subs-pop").hide(); }); $(".search-submit").click(function() { if ($("#search-form-1").val().trim() == '') { alert("请输入要搜索的内容"); return false; } }) if (GetQueryString("tag") != '') { var tag = GetQueryString("tag"); $("#news-tag-" + tag).addClass("active"); } });