$(document).ready(function(){ try { var browser = navigator.appName var b_version = navigator.appVersion var version = b_version.split(";"); var trim_Version = version[1].replace(/[ ]/g, ""); if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") { $(".tip").css("display", "block"); } else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE7.0") { $(".tip").css("display", "block"); } else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE8.0") { $(".tip").css("display", "block"); } } catch (e) { } $(".head_search").click(function(){ $('.head_search_hide').slideToggle(); if($('.header').hasClass("pb32")){ $('.header').removeClass("pb32"); }else{ $('.header').addClass("pb32"); } }) $(".phone_menu").click(function(e){ if ($(this).hasClass("on")) { $(this).removeClass("on"); $(".nav_wraper ul").removeClass("on"); } else { $(this).addClass("on"); $(".nav_wraper ul").addClass("on"); } }) if($(".phone_menu").is(":hidden")){ }else{ $("a").each(function(){ $(this).attr("target","_self") }) $(".nav_wraper ul > li").each(function(i){ if(i!=0 && $(this).find("dl").size()!=0){ $(this).children("a").attr("href","javascript:void(0)"); $(this).children("a").click(function(){ $(this).next().addClass("on"); }) } $(this).find("dl dd:eq(0)").click(function(){ $(this).parent().removeClass("on"); }) }) } /*闆嗗洟绠€浠?/ imgratio1(".ab_about02 ul li img"); // console.log($(".ab_about02 ul li:first-child").height()/2-1) // $(".ab_about02 ul li.sm").height(($(".ab_about02 ul li:first-child").height()+1)/2-1) $(window).resize(function(){ // imgratio1(".ab_about02 ul li:first-child"); // $(".ab_about02 ul li.sm").height(($(".ab_about02 ul li:first-child").height()+1)/2-1); imgratio1(".ab_about02 ul li img"); if($(window).width()<1280){ $(".ab_culture01").height($(".wraper_in").width()*0.5883); }else{ $(".ab_culture01").height($(".wraper_in").width()*0.5883); } if($(window).width()<768){ $(".ab_cul_box3 img,.ab_cul_box5 img,.ab_cul_box6 img").height($(".ab_cul_box1").height()); } }) $(window).resize(); //涓€閿垎浜 var shareUrl=window.location.href; $('.share>a').each(function(index,elem){ var shareId=$(this).data('share'); var shareTitle=$(this).data('title'); var a_href; if($(this).hasClass('other_wx')){ a_href="weixin.html?type="+shareUrl }else{ a_href="http://www.jiathis.com/send/?webid="+shareId+"&url="+shareUrl+"&title="+shareTitle } $(this).attr('href',a_href); }); document.oncontextmenu = function(){ event.returnValue = false; } document.oncontextmenu = function(){return false;} }) function openUrl(url){ window.location.href=url; } function imgratio1(ele) { $(ele).each(function (index, element) { if ($(this).is(":visible")) { //褰撳墠鍏冪礌鍙 $(this).css({ height: Math.ceil($(this).width() * $(this).data("ratio")) });//Math.floor鍚戜笅鍙栨暣 } }); } window.onload = function(){ if($(window).width()<768){ $(".ab_cul_box3 img,.ab_cul_box5 img,.ab_cul_box6 img").height($(".ab_cul_box1").height()); } // $(".ab_cul_box3 .ab_culture01_wraper").height($(".ab_cul_box1").height()); }