function winresize(dynamic_news, dynamic_act){ if( navigator.useragent.match(/android/i) || navigator.useragent.match(/iphone/i) || navigator.useragent.match(/symbian/i) || navigator.useragent.match(/windows phone/i) ){ $(".dynamic_con .dynamic_act .swiper-wrapper").css("padding-bottom", 50 + dynamic_news - dynamic_act) }else{ $(".dynamic_con .dynamic_act .swiper-wrapper").css("padding-bottom", 100 + dynamic_news - dynamic_act) } } var nav_timer; var timer_nav; function shownav(e){ var that = $(this); var index_nav = that.index(); var nav_inner = $(".nav_con_pc .nav-inner").eq(index_nav - 1); cleartimeout(nav_timer); timer_nav = settimeout(function(){ $(".nav_con_pc .nav-inner").not(nav_inner).removeclass("block"); $(".nav_con_pc").addclass("cur"); // that.siblings().removeclass("cur"); that.addclass("cur"); settimeout(function(){ nav_inner.addclass("block"); that.addclass("cur").siblings().removeclass("cur"); }, 10) }, 100) } function hidenav(nav_inner, i2){ var inner_hover = $(".block") cleartimeout(timer_nav); nav_timer = settimeout(function(){ if (inner_hover.hasclass('inner_hover')) // && i2.hasclass("cur") return; $(".head_main .nav li").removeclass("cur"); $(".nav_con_pc").removeclass("cur"); inner_hover.removeclass("block"); }, 100) } $(function(){ $(".car_list .car_thr ul li .car_car_b .car_car_b_t span.car_price").each(function(){ if($(this).text() == ""){$(this).hide()} }) winresize(); $(window).resize(function(){ winresize($(".dynamic_con .dynamic_news img").height(), $(".dynamic_con .dynamic_act img").height()) }); var timer; $(".nav_rr ul li.gotop").click(function(){ $("body, html").animate({scrolltop: 0}); /*cancelanimationframe(timer); timer = requestanimationframe(function fn(){ var otop = document.body.scrolltop || document.documentelement.scrolltop; if(otop > 0){ scrollto(0,otop-50); timer = requestanimationframe(fn); }else{ cancelanimationframe(timer); } });*/ }) $(".head_r .login").hover(function(){ $(".head_r .login i.icon_user").addclass("cur"); $(this).find(".login_con").stop().fadein("200"); },function(){ $(".head_r .login i.icon_user").removeclass("cur"); $(this).find(".login_con").stop().fadeout("200"); }) $(".head_r .head_r_b .head_r_b_l li.language").hover(function(){ $(this).find(".language_sec").stop().slidetoggle("200"); }) $(".car_category ul li").eq(0).addclass("cur"); $(".car_con_list .car_list").eq(0).show(); $(".car_list").each(function(e){ $(this).find(".car_er ul li").eq(0).addclass("cur"); }) $(".car_con_list .car_list").each(function(e){ $(this).find(".car_thr ul").eq(0).show(); }) $(".car_category ul li").hover(function(){ $(this).addclass("cur").siblings().removeclass("cur"); $(".car_con_list .car_list").eq($(this).index()).show().siblings().hide(); }) $(".car_list .car_er ul li").hover(function(){ $(this).addclass("cur").siblings().removeclass("cur"); $(this).parents(".car_list").find(".car_thr ul").eq($(this).index()).show().siblings().hide(); }) $(".foot .foot_t .foot_t_r ul li.url").hover(function(){ $(this).find("div").stop().slidetoggle("200"); }) $('.nav-inner').hover(function() { $(this).addclass('inner_hover'); var i = $('.nav-inner').index(this); $('.head_main .nav li').eq(i + 1).addclass('cur'); }, function() { var i = $(this).index(); var i2 = $(".head_main .nav li").eq(i + 1); $(this).removeclass('inner_hover'); hidenav($(this), i2); }); $(".head_main .nav li:gt(0)").hover(shownav, function(){ var nav_inner = $(".nav_con_pc .block"); var i2 = $(this); hidenav(nav_inner, i2); }) // mob $(".head_phone .nav_mob").click(function(){ $(this).toggleclass("cur"); $(".head_phone .nav_con_mob").stop().slidetoggle("200"); }) $(".nav_con_mob > ul > li").click(function(){ var nav_er_mob = $(this).find(".nav_er_mob"); if (!nav_er_mob) { return } $(this).toggleclass("cur").siblings().removeclass("cur"); nav_er_mob.stop().slidetoggle("200"); $(this).siblings("li").find(".nav_er_mob").stop().slideup("200"); }) //index $(".section.foot_mob .foot_mob_t .law span").click(function(){ $(this).parents(".law").find("ul").stop().slidetoggle("200"); }) // weibo $(".foot .foot_t .foot_t_r .share div.weixin").hover(function(){ $(this).find("img").stop().fadetoggle("200"); }) }) function setcookie(name,value) { if (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()+";path=/"; } } function check(form) { var str = form.q.value; /* var pat = new regexp("/^(\w|[\u4e00-\u9fa5])*$/"); var result = pat.test(str); if (result == true){ return true; }else{ return false; } */ // 鍙兘鏄腑鏂囷紝鑻辨枃锛屾暟瀛楋細 var reg = /^(\w|[\u4e00-\u9fa5])*$/; if(str == ""){ alert("璇疯緭鍏ユ偍瑕佹悳绱㈢殑鍏抽敭璇?); return false; }else if(arr=str.match(reg)) { ti=1; return true; } else { alert("鍙厑璁歌嫳鏂?鏁板瓧,姹夊瓧"); return false; } } //鑾峰彇cookie function getcookievalue(cookiename) { var cookievalue = document.cookie; var cookiestartat = cookievalue.indexof(""+cookiename+"="); if(cookiestartat==-1) { cookiestartat = cookievalue.indexof(cookiename+"="); } if(cookiestartat==-1) { cookievalue = null; } else { cookiestartat = cookievalue.indexof("=",cookiestartat)+1; cookieendat = cookievalue.indexof(";",cookiestartat); if(cookieendat==-1) { cookieendat = cookievalue.length; } cookievalue = unescape(cookievalue.substring(cookiestartat,cookieendat));//瑙g爜latin-1 } return cookievalue; }