//=========== input,select focus==================== function _initInputs(){ //初始化 input,select focus事件 $("input,select").focus( function(){ $(this).addClass("inputFocus"); } ); $("input,select").blur( function(){ $(this).removeClass("inputFocus"); } ); } function _initSelect(){ //初始化 input,select focus事件 $(".select").focus( function(){ $(this).addClass("selectFocus"); } ); $(".select").blur( function(){ $(this).removeClass("selectFocus"); } ); } function _datePicker(){ //初始化 input,select focus事件 $(".date_picker").focus( function(){ $(this).addClass("date_pickerFocus"); } ); $(".date_picker").blur( function(){ $(this).removeClass("date_pickerFocus"); } ); } /* $(function(){ var $w=$('.activity_banner img').width(); var $m=-$w/2+'px'; $('.activity_banner').css({"width":$w+"px","margin-left":$m}); }) */ function _inittextarea(){ //初始化 input,select focus,textarea(事件 $(".lytex").focus( function(){ $(this).addClass("inputFocus"); } ); $(".lytex").blur( function(){ $(this).removeClass("inputFocus"); } ); } $(function(){ _initInputs(); _datePicker(); _initSelect(); swtichTool(".productBox .tabsList .item","active",".content","click"); swtichTool(".gaiKuobtnList .tabsList li","active",".contentBox","click"); swtichTool(".warp .loginBox_content .tabTitle li","active",".tabCont","click"); //rollToolVertical(".notice_mb .noticeList ul",".notice_mb .noticeList li",2,50,true,4000,400); containerCenter(); /*二维码*/ $("#block-erweima").hover(function(){ /*$(this).find(".phone").stop().fadeIn(500);*/ $(this).find(".phone").css({"display":"block"}); },function(){ /*$(this).find(".phone").stop().fadeOut(500);*/ $(this).find(".phone").css({"display":"none"}); }) /*电话*/ $("#block-phone-num").hover(function(){ /*$(this).find(".block-phone-num").stop().animate({ 'width' : '180px', 'opacity' : "1" },200);*/ $(this).find(".block-phone-num").css({"display":"block","width":180+"px","opacity":1}); },function(){ /*$(this).find(".block-phone-num").stop().animate({ 'width' : '0', 'opacity' : "0" },200);*/ $(this).find(".block-phone-num").css({"display":"none"}); }); /*$(".hd_fxgd").click(function(){ $(".hd_fx").addClass("hd_auto"); });*/ moreBoxOpen(".hd_fxgd",".hd_fx",".hd_fxgd i",".hd_fxgd p") moreBoxOpen(".hd_fxgd2",".hd_fx1",".hd_fxgd2 i",".hd_fxgd2 p") function moreBoxOpen(obj,content,btnIocn,txt){ var fal=false; $(obj).on("click",function(){ if(fal){ $(content).css("height",""); //$(content).slideUp() $(txt).html("查看更多") $(btnIocn).removeClass("icon-arrow_down-copy") fal=false; }else{ $(content).css("height","auto"); fal=true; $(btnIocn).addClass("icon-arrow_down-copy") $(txt).html("点击缩起") } //$(".txtContent").animate({height:"auto"},400) }) }; /*立即预约弹窗开始*/ $(".zhlc_yuebtn").click(function(){ $(".zhlc_tc").show(); }); $(".zhlc_yuetitle i").click(function(){ $(".zhlc_tc").hide(); }); $(".zhlc_bdtj span.qx").click(function(){ $(".zhlc_tc").hide(); }); var box1 = $(".yd_qh"); box1.each(function() { var dh = $(this).find(".yd_lct li"); var nr = $(this).find(".yd_bz .yd_bznr"); dh.on("click",function(){ var nrindex = $(this).index();//定义当前index $(".yd_lct li").addClass("gao"); $(this).addClass("hot").siblings().removeClass("hot"); nr.eq(nrindex).show().siblings().hide(); }); }); $(".fw_jysub li").last().css("border-right","none"); var box2 = $(".fw_qhbox"); box2.each(function() { var dh1 = $(this).find(".fw_jysub li"); var nr1 = $(this).find(".fw_qhnr .fw_listnr"); dh1.on("click",function(){ var nrindex1 = $(this).index();//定义当前index $(this).addClass("hot").siblings().removeClass("hot"); nr1.eq(nrindex1).show().siblings().hide(); }); }); /*立即预约弹窗结束*/ lastborder(".zixunContent .list1 li"); lastborder(".zixunContent .list2 li"); function lastborder(obj){ $(obj).last().css("border-bottom","none"); } var i =0; var clone = $(".hd_jlnr .img li").first().clone(); $(".hd_jlnr .img").append(clone); var size = $(".hd_jlnr .img li").size() /*定时器每隔2秒*/ var t=setInterval(Lleft,5000); $(".hd_jlnr").hover(function(){ clearInterval(t); },function(){ t=setInterval(Lleft,5000); }); /*点击左边*/ $(".hd_jlglleft").click(function(){ Lleft() }); function Lleft(){ i++ if(i==size){ $(".hd_jlnr .img").css({left:0}); i=1; } $(".hd_jlnr .img").stop().animate({left:-i*920},500); } /*点击左边*/ $(".hd_jlglright").click(function(){ Rright() }); function Rright(){ i-- if(i==-1){ $(".hd_jlnr .img").css({left:-(size-1)*920}); i=size-2; } $(".hd_jlnr .img").stop().animate({left:-i*920},500); } $(".ab_job li .ab_jobtitle").click(function(){ $(this).parent().toggleClass("hot"); }); $(".fw_wtnr li .fw_wtnrtop").click(function(){ $(this).parent().toggleClass("hot"); }); /*返回顶部*/ $('#return_top').click(function() { //改元素点击的时候 $('html,body').animate({ scrollTop: 0 }, 600); //让 body 的 scroolTop 设为 0 }); _initWapNav(); var initTop=40 $(window).bind("scroll", function(event){ if($(window).scrollTop()>initTop){ $(".pc_header .top").css({"display":"none"}); } else{ $(".pc_header .top").css({"display":"block"}); } }); $(".productBox .tabsList .item").css({"width":(100/$(".productBox .tabsList .item").length)+"%"}); $($(".productBox .tabsList .item")[$(".productBox .tabsList .item").length-1]).addClass("no_border_r"); $(".gaiKuoProductBox .dateBtn p").on("click",function(){//选项 卡 var index=$(this).index(); $(".gaiKuoProductBox .dateBtn p").removeClass("active"); $(this).addClass("active"); $(".gaiKuoProductBox .rateImgBox").css({"display":"none"}); $(".gaiKuoProductBox .rateImgBox").eq(index).css({"display":"block"}); }); _initInterceptText(); }) function _initWapNav(){ $(".header_m .nav_btn").bind("click",function(){ $(".mb_navlist").css({"display":"block"}); $(".mb_navlist").removeClass("slideOutUp animated"); $(".mb_navlist").addClass("slideInDown animated"); }); $(".mb_navlist .nav_btn_close").bind("click",function(){ $(".mb_navlist").removeClass("slideInDown animated"); $(".mb_navlist").addClass("slideOutUp animated"); }); $(".mb_navlist li").bind("click",function(){ $(".mb_navlist li").removeClass("current"); $(this).addClass("current"); }) } /*立即预约漂浮开始*/ $(window).scroll(function() { var $window = $(window); var $document = $(document); var winHeight = window.innerHeight ? window.innerHeight : $window['height'](); // iphone fix var closeToBottom = ($window['scrollTop']() + winHeight > $document['height']() - 465); //滚动条距离页面底部小于320像素 var closeToBottomrelat = ($window['scrollTop']() + winHeight < $document['height']() - 465); //滚动条距离页面底部小于320像素 if (closeToBottom) { //滚动条距离页面底部小于100像素,开始新的加载 $(".zhlc_yue").css({"position":"relative","bottom":"0px","height":"110px","padding-top":"30px"}); if ($("#footer")) { $("#footer").css("margin-top","0px"); } } if(closeToBottomrelat){ $(".zhlc_yue").css({ "position":"fixed", "bottom":"-1px", "height":"70px", "padding-top":"10px" }); if ($("#footer")) { $("#footer").css("margin-top","100px"); } } }); /*立即预约漂浮结束*/