$(function(){ w_h=$(window).height(); $(window).resize(function(){ w_h=$(window).height() }) // /*$(window).scroll(function(){ var _h = $(window).scrolltop(); if(_h>650){ $(".top").show(); }else{ $(".top").hide(); } });*/ $(".top .icon_top").click(function(){ $("html,body").animate({scrolltop:0}); }); $(".top").children("li").children("a").mouseenter(function(){ $(this).siblings().show(); $(this).parents("li").siblings().children("a").siblings().hide(); }) $(".top").children("li").children("a").siblings().mouseleave(function(){ $(this).hide(); }) // /* $(".search_type select").change(function(){ var _v = $(this).children("option:selected").html(); $(".search_type span").html(_v); }); */ //投资者关系 $(".relation1_menu li:not(:last-child) a").click(function(e){ e.preventdefault(); var index = $(this).parent().index(); $(this).addclass("current").parent().siblings().find("a").removeclass("current"); $(this).parents("ul").siblings().find(".relation1_list").eq(index).removeclass("hide").siblings().addclass("hide"); }) //分享 $(".share_sina").click(function(){ jiathis_sendto('tsina');return false; }) $(".share_qq").click(function(){ jiathis_sendto('tqq');return false; }) //20140910 $(".share_qqzone").click(function(){ jiathis_sendto('qzone');return false; }) $(".share_weixin").click(function(e){ e.preventdefault(); $('
').prependto("body"); $(".bg").show(); var weixin_h = $(".news_weinxin").height(); var weixin_h1 = (w_h-weixin_h)/2+$(window).scrolltop(); $(".news_weinxin").stop().css({"top":weixin_h1}); $(".news_weinxin").show(); }) $(".share_frend").click(function(){ jiathis_sendto('cqq');return false; }) $(".news_weinxin .close").click(function(e){ e.preventdefault(); $(".news_weinxin").hide(); $(".bg").hide(); $(".bg").remove(); }) //新闻详情页 单选框 $(".investe input[checked$='checked']").parent().css({ "background": "url("+_url_+"/content/pc/images/radio_yes.png) no-repeat 0 0" }); $(".investe input:radio").next("label").click(function () { var _obj = $(this).parent("span") var _input = $(this).prev("input"); var _stat = _input.attr("checked"); _obj.css({ "background": "url("+_url_+"/content/pc/images/radio_yes.png) no-repeat 0 0" }).siblings().css({ "background": "url("+_url_+"/content/pc/images/radio_no.png) no-repeat 0 0" }); }); //发展历程 $(".years li .t a").click(function(e){ e.preventdefault(); $(this).parent(".t").hide(); $(this).parent(".t").siblings(".b").slidedown().parents("li").siblings().find(".t").show().siblings(".b").slideup(); $(this).parents("li").css({"margin-top":"0"}).siblings().css({"margin-top":"-215px"}); $(".years li.first").css({"margin-top":"0"}); $(this).parents("li").next().css({"margin-top":"0"}); }) //用户服务下拉框 $(document).click(function(){ $(".select ul").hide(); }); $(".select").click(function(e){ e.stoppropagation(); $(this).find("ul").toggle(); }); $(".select li a").click(function(){ var _v = $(this).html(); var _p = $(this).parents(".select").find("div"); _p.html(_v); //pass value }); //社会招聘 $(".side_list .job_social").children("a").click(function(e){ e.preventdefault(); $(this).toggleclass("close"); $(this).siblings().slidetoggle(); }) //20140914 首页 $(".f_links").children("ul").children("li.hover").mouseenter(function(){ $(this).find("ul").slidedown(); $(this).children("a").addclass("on"); }) $(".f_links").children("ul").children("li.hover").mouseleave(function(){ $(this).children("ul").stop().slideup(); $(this).children("a").removeclass("on"); }) //20140914 首页导航 $(".mr_list").children("li.hover").mouseenter(function(){ $(this).children("a").addclass("on"); $(this).find("ul").slidedown(); }) $(".mr_list").children("li.hover").mouseleave(function(){ $(this).children("a").removeclass("on"); $(this).find("ul").stop().slideup(); }) $(".f_sns a.attent_weixin").click(function(e){ e.preventdefault(); }) ///////////////////////////////////////////////xiaofeng //表单提交成功 $("#liuyan").click(function(e){ var loginid = $("#loginid").val(); $.ajax({ url : _url_+"/service/savereservation?id=" + loginid, success : function(data) { if(data==1){ e.preventdefault(); $('
').prependto("body"); $(".bg").show(); var no_login_h = $(".success").height()+15; var no_login_h1 = (w_h-no_login_h)/2+$(window).scrolltop(); $(".success").stop().css({"top":no_login_h1}); $(".success").show(); }else{ alert("出错啦!请从新填写提交!"); return false; } }, error : function() { alert("出错啦!请从新填写提交!"); return false; } }); }) $(".success .btn").click(function(e){ e.preventdefault(); $(".success").hide(); $(".bg").hide(); $(".bg").remove(); location.href = _url_+"/service/reservation"; }) //20140910 常见问题 $("ul.q_list li h3 a").click(function(e){ e.preventdefault(); $(this).parent().siblings().slidetoggle(); $(this).parents("li").siblings().find(".answer").slideup(); }) //20140914导航 en $(".lang a.title").click(function(e){ e.preventdefault(); $(".lang_menu").toggle(); }) $(".lang_menu .close").click(function(e){ e.preventdefault(); $(".lang_menu").hide(); }) //20140914 aboutus $(".menu_aboutus li a").click(function(e){ e.preventdefault(); var index = $(this).parent().index(); $(this).addclass("current").parent().siblings().find("a").removeclass("current"); $(this).parents("ul").siblings().find(".aboutus_item").eq(index).removeclass("hide").siblings().addclass("hide"); }) //20140914 邮件订阅 //20140917 修改 $(".subscription").click(function(e){ e.preventdefault(); $('
').prependto("body"); $(".bg").show(); var pop_email_h = $(".pop_email").height()+200; var pop_email_h1 = (w_h-pop_email_h)/2+$(window).scrolltop(); $(".pop_email").stop().css({"top":pop_email_h1}); $(".pop_email").show(); $(".pop_email .email_form").show(); $(".pop_email .email_success").hide(); }) //新闻订阅 $(".email_form .btn").click(function(){ var istrue = sub_email(); if(istrue == true){ var name = $(".email_form .name").val(); var email = $(".email_form .email").val(); $.ajax({ url : _url_+"/news/email", data: {name:name,email:email}, type: "post", success : function(data) { if(data==1){ $(".pop_email .email_form").hide(); $(".pop_email .email_success").show(); }else{ alert("出错啦!请从新填写提交!"); $(".pop_email").hide(); $(".pop_email .email_form").hide(); $(".bg").hide(); $(".bg").remove(); } }, error : function() { alert("出错啦!请从新填写提交!"); return false; } }); } }) //投资者关系订阅 $(".email_form .inves_btn").click(function(){ var istrue = sub_email(); if(istrue == true){ var name = $(".email_form .name").val(); var email = $(".email_form .email").val(); $.ajax({ url : _url_+"/investors/email", data: {name:name,email:email}, type: "post", success : function(data) { if(data==1){ $(".pop_email .email_form").hide(); $(".pop_email .email_success").show(); }else{ alert("出错啦!请从新填写提交!"); $(".pop_email").hide(); $(".pop_email .email_form").hide(); $(".bg").hide(); $(".bg").remove(); } }, error : function() { alert("出错啦!请从新填写提交!"); return false; } }); } }) $(".pop_email .close").click(function(e){ e.preventdefault(); $(".pop_email").hide(); $(".pop_email .email_form").hide(); $(".pop_email .email_success").hide(); $(".bg").hide(); $(".bg").remove(); }) $(".email_success .btn").click(function(e){ e.preventdefault(); $(".pop_email").hide(); $(".pop_email .email_form").hide(); $(".pop_email .email_success").hide(); $(".bg").hide(); $(".bg").remove(); }) function sub_email() { var user = $('.pop_email .name').val(); var email = $('.pop_email .email').val(); var istrue = true; //20140923 start if (user == "") { alert("对不起,姓名不能为空!"); $('.name').focus(); istrue = false; } if (user == "请输入您的姓名") { alert("对不起,姓名格式不正确!"); $('.name').focus(); istrue = false; } if (email == "") { alert("对不起,邮箱不能为空!"); $('.email').focus(); istrue = false; } if (email == "请输入您的email") { alert("对不起,邮箱格式不正确!"); $('.email').focus(); istrue = false; } //20140923 stop var reg = new regexp("^['_a-za-z0-9-]+(\\.['_a-za-z0-9-]+)*@([a-za-z0-9-])+(\\.[a-za-z0-9-]+)*((\\.[a-za-z0-9]{2,})|(\\.[a-za-z0-9]{2,}\\.[a-za-z0-9]{2,}))$"); if(!reg.test(email)) { alert("对不起,邮箱格式不正确!!"); $('.email').focus(); istrue = false; } return istrue; } //服务 $(".morepro a ").click(function(e){ e.preventdefault(); $(".pro_more").show(); }) $(".pro_more .close").click(function(e){ e.preventdefault(); $(".pro_more").hide(); }) //20140918用户服务下拉框 $(document).click(function(){ $(".search_type ul").hide(); }); $(".search_type").click(function(e){ e.stoppropagation(); $(this).find("ul").toggle(); }); $(".search_type li a").click(function(){ var _v = $(this).html(); var _p = $(this).parents(".search_type").find("div"); _p.html(_v); }); //20140919 首页滚动 //roll newss function rollnews1() { var _roll = $(".news_roll1"); _roll.animate({ "top": "-50px" }, function () { _roll.find("li:first").appendto(_roll); _roll.css("top", "0"); }) } function rollnews2() { var _roll = $(".news_roll2"); _roll.animate({ "top": "-50px" }, function () { _roll.find("li:first").appendto(_roll); _roll.css("top", "0"); }) } roll1 = setinterval(rollnews1, 3000); roll2 = setinterval(rollnews2, 3000); //20141120 下拉框最后一个元素 $(".select ul li:last-child").addclass("last"); }); $(window).scroll(function(){ if (0 <= $(window).scrolltop()) { var w_h = $(window).height(); var weixin_h = $(".news_weinxin").height(); var weixin_h1 = (w_h-weixin_h)/2+$(window).scrolltop(); $(".news_weinxin").stop().css({"top":weixin_h1}); var pop_email_h = $(".pop_email").height()+200; var pop_email_h1 = (w_h-pop_email_h)/2+$(window).scrolltop(); $(".pop_email").stop().css({"top":pop_email_h1}); } });