var issupporttouch = $(window).width() <= 1024; var historynum = 0; (function ($) { $(function () { /*if(!$(".menu_phone").is(":hidden")){ $(".other_banner > img").attr("src",$(".other_banner > img").attr("data-phone")); }*/ if($(".menu_phone").is(":hidden")){ var headt = $(".header").height(); $(window).scroll(function () { var st = $(window).scrolltop(); if (st >= headt) { $(".header").addclass("fixedhede").fadein(); //$(".main").css({ paddingtop: headt }) } else { $(".header").removeclass("fixedhede"); //$(".main").css({ paddingtop: 0 }) } }) } $(".span02down input").focus(function(){ $(this).blur(); }) //nav if ($(".menu_phone").is(":hidden")) { var navtimer = null; $(".header_bottom > nav li").hover(function () { if ($(this).find("span").size() == 0) return false; cleartimeout(navtimer); $(this).find(".nav_down").css({ "left": "50%", "marginleft": $(this).find(".nav_down").width() / 2 * -1 - 18, "display": "block" }); $(".nav_down_bg").css({ "display": "block" }); $(this).find("i").css({ "display": "block" }); $(this).siblings().find(".nav_down").hide(); $(this).siblings().find("i").hide(); }, function () { var $h = $(this); navtimer = settimeout(function () { $h.find(".nav_down").css({ "display": "none" }); $(".nav_down_bg").css({ "display": "none" }); $h.find("i").hide(); }, 100) }) } else { $(".footer_top_l").insertbefore(".footer_top_r"); $(".footer_top_r").css("paddingbottom", 10); $(".footer_top_l").css({"paddingbottom":0,"paddingtop":0}); $(".header_bottom > nav li").click(function () { if ($(this).hasclass("show")) { $(this).removeclass("show"); } else { $(this).addclass("show").siblings().removeclass("show"); } }) } $(".history_top_main ul li:last").after('
'); $(window).resize(function () { if ($(".menu_phone").is(":visible")) { $(".searchwrap").width($(window).width() - 20); $(".searchwrap").css({ "left": "50%", "marginleft": ($(window).width() - 20)/2*-1 }); } }) $(window).resize(); var settimer=null; $(".searchwrap").hover(function(){ cleartimeout(settimer); $(".searchwrap_box").show(); },function(){ settimer=settimeout(function(){ $(".searchwrap_box").hide(); },300) }) $(".span02down").click(function(){ if($(this).find("dl").is(":hidden")){ $(this).find("dl").show(); return false; }else{ $(this).find("dl").hide(); } $(this).find("dl").width($(this).width()-2); }) $(".span02down dd").click(function(){ $(".span02down > input").val($(this).text()).attr("value", $(this).text()); $(".span02down dl").hide(); return false; }) $(document).click(function () { $(".span02down dl").hide(); }) $('.font_size a').click(function () { var index = jquery(this).index(); jquery(this).addclass('on').siblings().removeclass('on'); if (index == 0) { $('.conts').css('font-size', '14px'); } else if (index == 1) { $('.conts').css('font-size', '18px'); } }) $(".span03 i").click(function () { if (!$(this).hasclass("active")) { $(this).removeclass("active").addclass("active"); $(this).siblings("i").removeclass("active"); $(this).find("input").prop("checked", true); $(this).siblings("i").find("input").prop("checked", false); } }) $(".contact_active li dl").height($(".contact_active li:eq(0) dl").height()); $(".inv_notice_l li:odd").addclass("odd"); var bg_cur = 0 //褰撳墠椤垫暟 var listnum = 0 //鎬婚〉 var mousew = true;//鏄惁婵€娲绘粴鍔� var listnum = 3//鎬诲睆鏁� var winh = $(window).height(); if ($(".in_banner li").length <= 0) { $(".bx-controls-direction").hide(); } if ($(".phone_bxslider1 ").find("li").length <= 1) { if($(window).width()>1024){ $(".scrollpage0,.scrollpage1,.scrollpage2").css({"height":$(window).height()}); $(".phone_bxslider1 li img").css({"marginleft":$(window).height()/0.38/2*-1,"left":"50%"}); $(".main_part3").css({ "width": $(window).width()}); $(".main_part3").css({ "height": $(window).height() }); }else{ $(".scrollpage0").css({"height":$(window).width()*0.38}); $(".main_part3").css({ "width": $(window).width()}); $(".main_part3").css({ "height": $(window).height()*0.5 }); } } else { //$(".scrollpage0").css({"height":$(window).height(),"width":$(window).height()/0.38,"left":"50%","marginleft":$(window).height()/0.38/2*-1,"position":"relative"},function(){ //}) $('.phone_bxslider1').bxslider({ auto: true, autocontrols: true, onslidebefore:function(){ $(".bx-wrapper .bx-viewport ul li img").css("marginleft",$(".bx-wrapper .bx-viewport ul li:eq(0) img").width()/2*-1); } }); } $(".menu_phone").click(function () { if ($("nav").hasclass("show")) { $("nav").removeclass("show"); } else { $("nav").addclass("show"); } }) $(".right_menu li").click(function () { var nindex = $(".right_menu li").index(this); $(this).removeclass().addclass("active").siblings().removeclass(); try{ if(nindex==0){ $("body,html").stop().animate({ scrolltop: 0}, 800, "easeoutquad") }else{ $("body,html").stop().animate({ scrolltop: $(".scrollpage" + nindex).offset().top}, 800, "easeoutquad") } } catch (e) { } bg_cur = nindex; }) if ($(".menu_phone").is(":hidden")) { $(".main_part2_part").css({ "top": "50%", "margintop": $(".main_part2_part").height() / 2 * -1+50 }).show(); } $(".comp_reset").click(function(){ $(".again").click(); }) /*$(".contact_active li:nth-child(4n-2)").addclass("odd"); $(".contact_active li:nth-child(4n-1)").addclass("odd");*/ $(".contact_active li").addclass("odd"); $(".cul_active_part li:odd").addclass("odd"); var historysize = $(".history_top_main li").length; var historygroup = $(".history_top_main").width() / 124; $(".history_top_l").addclass("active"); $(".history_top_r").click(function () { if (!$(".history_top_main ul").is(":animated")) { if (historynum >= historysize - 2) { $(".history_top_r").addclass("active"); } if (historynum >= historysize - 1) { } else { historynum++; $(".history_top_l").removeclass("active"); var movepoint = historygroup / 2-1; var endpoint= historysize -movepoint; if (historynum > movepoint && historynum < endpoint-1) { $(".history_top_main ul").stop().animate({ "left": "-=250" }); } $(this).prev().find("li").eq(historynum).click(); } } }) $(".history_top_l").click(function () { if (!$(".history_top_main ul").is(":animated")) { if (historynum <= 1) { $(".history_top_l").addclass("active"); } if (historynum <= 0) { } else { historynum--; $(".history_top_r").removeclass("active"); var movepoint = historygroup / 2 - 1; var endpoint = historysize - movepoint; if (historynum > movepoint && historynum < endpoint - 1) { $(".history_top_main ul").stop().animate({ "left": "+=250" }); } $(this).next().find("li").eq(historynum).click(); } } }) //$(".right_menu li:eq(0)").click(); if (document.getelementbyid("home")) { if (!issupporttouch) { /* if(getcookie("scrollpagecookie")=="1"){ $("body,html").stop().animate({ scrolltop: $(".scrollpage1").offset().top }, 600, "easeoutquad"); bg_cur=1; }else if(getcookie("scrollpagecookie")=="3"){ $("body,html").stop().animate({ scrolltop: $(".scrollpage3").offset().top }, 600, "easeoutquad"); bg_cur=3; }else{ $("body,html").stop().animate({ scrolltop: 0 }, 600); } */ $(document).mousewheel(function (event, delta, deltax, deltay) { if (delta < 0) { if (mousew) { if(!$("body,html").is(":animated")){ bg_cur++; bg_cur > listnum ? bg_cur = listnum : 0; mousew = false; try { $(".right_menu li:eq("+bg_cur+")").click(); mousew = true; } catch (e) { } $(".right_menu li:eq(" + bg_cur + ")").removeclass().addclass("active").siblings().removeclass(); } } } else if (delta > 0) { if (mousew) { if(!$("body,html").is(":animated")){ bg_cur--; mousew = false; bg_cur < 0 ? bg_cur = 0 : 0; try { $(".right_menu li:eq("+bg_cur+")").click(); mousew = true; } catch (e) { } $(".right_menu li:eq(" + bg_cur + ")").removeclass().addclass("active").siblings().removeclass(); } } } return false; }) } } try { $(".group0").colorbox({ rel: 'group0' }); $("#cboxcontent").css("width", $(window).width() - 42); } catch (e) { } if (!$(".menu_phone").is(":visible")) { $(".culture_part").each(function () { var eqlast = $(this).find("li").size() - 1; var eqlast_1 = $(this).find("li").size() - 2; $(this).find("li").eq(eqlast).css("marginbottom", 0); $(this).find("li").eq(eqlast_1).css("marginbottom", 0); }) $(".culture_menu ul li").hover(function(){ $(this).removeclass("on").addclass("on").siblings().removeclass("on"); },function(){ $(this).removeclass("on"); }) }else{ if($(".header_bottom > nav li").find("span").size()>=1){ $(".header_bottom > nav li > a").attr("href","javascript:void(0)"); } } }) $(function () { imgratio()//鍒濆鍖栧浘鐗噐atio //绐楀彛鏀瑰彉澶у皬鍥炶皟ratio锛� var rtime = new date(); var timeout = false; var delta = 200; $(window).resize(function () { rtime = new date(); if (timeout === false) { timeout = true; settimeout(resizeend, delta); //resize鍙洖璋冩渶鍚庝竴娆� } }); function resizeend() { //window.resize鍥炶皟 if (new date() - rtime < delta) { settimeout(resizeend, delta); } else { timeout = false; imgratio()//ratio } } // }) var nullimg = 'images/error.png'; function lod(t) { t.onerror = null; t.src = nullimg } $(function () { $(".ratio-img").each(function () { if ($(this).attr("src") == "") { $(this).attr({ "src": nullimg }) } }) }) })(jquery); function imgratio() { $(".ratio-img").each(function (index, element) { if ($(this).is(":visible")) { $(this).css({ height: math.floor($(this).width() * $(this).data("ratio")) }); } }); } function doprint() { bdhtml = window.document.body.innerhtml; sprnstr = ""; eprnstr = ""; prnhtml = bdhtml.substr(bdhtml.indexof(sprnstr) + 17); prnhtml = prnhtml.substring(0, prnhtml.indexof(eprnstr)); openwindow = window.open(""); openwindow.document.write("鎵撳嵃椤�<\/title><link href=\"..\/css\/common.css\" rel=\"stylesheet\" type=\"text\/css\" \/><link href=\"..\/css\/style.css\" rel=\"stylesheet\" type=\"text\/css\" \/><\/head><body><div id=\"printbox\" ><\/div><\/body><\/html>"); openwindow.document.getelementbyid("printbox").innerhtml = prnhtml; openwindow.document.close(); openwindow.print(); } var nullimg = '../images/error.jpg'; function lod(t) { t.onerror = null; t.src = nullimg } $(document).ready(function () { $("img").each(function () { if ($(this).attr("src") == "") { $(this).attr({ "src": nullimg }) } }) }) // function setcookie(name,value) { var days = 30; var exp = new date(); exp.settime(exp.gettime() + days*24*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" + exp.togmtstring(); } function getcookie(name) { var arr = document.cookie.match(new regexp("(^| )"+name+"=([^;]*)(;|$)")); if(arr != null) return unescape(arr[2]); return null; } function delcookie(name) { var exp = new date(); exp.settime(exp.gettime() - 1); var cval=getcookie(name); if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.togmtstring(); } function showvideo(title,url,fileurl){ if(fileurl == '') return false; var html = '<div id="goodcover"></div>' +'<div id="code">' +'<div class="close1"><a href="javascript:void(0)" id="closebt">x</a></div>' +'<div class="goodtxt">' +'<iframe height="500" width="100%" src="'+url+'" frameborder="0" allowfullscreen></iframe>' +'</div>' +'</div>'; $("body").append(html); $('#goodcover').fadein("slow"); $("#code").slidedown(200); $('#closebt,#goodcover').on('click', function() { $("#code").remove(); $('#goodcover').remove(); }); }