$(function () { if ($(window).width() > 800) { $("#Header .nav li").hover(function () { $(this).find(".nav2_tUl").stop(true, true).fadeIn(); }, function () { $(".nav2_tUl").stop(true, true).fadeOut(); }) } else { $("#Header .nav li").on("click", function () { $(this).find(".nav2_tUl").stop(true, true).slideToggle(); $(this).siblings().find(".nav2_tUl").stop(true, true).slideUp(); $(this).toggleClass("current").siblings().removeClass("current"); }) } var href = window.location.href if (href.search(/About/i) >= 0) { $("#nav li").eq(1).addClass("cur"); } else if (href.search(/News/i) >= 0) { $("#nav li").eq(2).addClass("cur"); } else if (href.search(/Business/i) >= 0) { $("#nav li").eq(3).addClass("cur"); } else if (href.search(/Investor/i) >= 0) { $("#nav li").eq(4).addClass("cur"); } else if (href.search(/Join/i) >= 0) { $("#nav li").eq(6).addClass("cur"); } else if (href.search(/Contact/i) >= 0) { $("#nav li").eq(7).addClass("cur"); } else { $("#nav li").eq(0).addClass("cur"); } if (href.search(/honest/i) >= 0 || href.search(/staff/i) >= 0 || href.search(/governance/i) >= 0 || href.indexOf("/Join/Inner") >= 0 || href.search(/management/i) >= 0) { $(".com_tLi").eq(1).addClass("cur"); } else if (href.search(/finance/i) >= 0 || href.search(/shareholder/i) >= 0) { $(".com_tLi").eq(2).addClass("cur"); } else if (href.search(/notice/i) >= 0 || href.search(/history/i) >= 0) { $(".com_tLi").eq(3).addClass("cur"); } else if (href.search(/inquire/i) >= 0 || href.search(/honor/i) >= 0) { $(".com_tLi").eq(4).addClass("cur"); } else if (href.search(/culture/i) >= 0) { $(".com_tLi").eq(6).addClass("cur"); } else if (href.search(/brand/i) >= 0) { $(".com_tLi").eq(5).addClass("cur"); } else if (href.search(/social/i) >= 0) { $(".com_tLi").eq(7).addClass("cur"); } else { $(".com_tLi").eq(0).addClass("cur"); } var pa = parseInt(href.split("pa=")[1]) || 0; if (pa > 0) { $(".com_tLi").eq(pa-1).addClass("cur").siblings().removeClass("cur"); } $(".com_iLi").eq(2).text($(".com_tLi.cur").text()) $(".ba_ti").after("
New Ecological Industrial City Service Provider
") /* 前端自适应双图处理,类名绑定(img_node绑图,bg_node绑背景),w-src(对应PC),t-src(对应微站) */ $(".img_node").each(function () { var _this = $(this); if ($(window).width() > 768) { _this.attr("src", $(this).attr("w-src")); } else { var src = $(this).attr("t-src") || $(this).attr("w-src"); _this.attr("src", src); } }) $(".bg_node").each(function () { var _this = $(this); if ($(window).width() > 768) { _this.css("background-image", "url(" + $(this).attr("w-src") + ")"); } else { var src = $(this).attr("t-src") || $(this).attr("w-src"); _this.css("background-image", "url(" + src + ")"); } }) /* * 自适应微站导航栏处理方案 *
*
* * */ //touch function hideNav() { $(".ind6_nav").removeClass("cur"); $("#Header .menu").css({ right: -220 }) $(".ind6_bgCol").stop(true, true).fadeOut(); } $(".ind6_nav").on("click", function () { if ($(".ind6_nav").hasClass("cur")) { hideNav(); } else { $(".ind6_nav").addClass("cur"); $("#Header .menu").css({ right: 0 }) $(".ind6_bgCol").stop(true, true).fadeIn(); } }) $(".ind6_bgCol").on("click", function () { hideNav(); }) $(".after").on("click", function () { $(".nav_ul").stop(true, true).slideUp(300); $(this).siblings(".nav_ul").stop(true, true).slideDown(300); }) $(".navCo_content").addClass("m" + $(".navCo_aBlock").length); $(".foI_aBlock").on("click", function () { $(this).toggleClass("cur").find(".foI_content").stop().slideToggle(); $(this).siblings().removeClass("cur").find(".foI_content").stop().slideUp(); }) //兼容苹果hover事件 $("div").on("mouseover", function () { }); //判断IE6、7、8提示下载新版IE function IEVersion() { var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; if (isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if (fIEVersion == 7) { return 7; } else if (fIEVersion == 8) { return 8; } else if (fIEVersion == 9) { return 9; } else if (fIEVersion == 10) { return 10; } else { return 6; //IE版本<=7 } } else if (isEdge) { return 'edge'; //edge } else if (isIE11) { return 11; //IE11 } else { return -1; //不是ie浏览器 } } if (IEVersion() > 5 && IEVersion() < 9) { $("body").append('
前往下载:https://support.microsoft.com/
') } $(".ba_tEn").html("new ecological industrial city service provider"); $("p img").css({ "height": "auto" }) })