msg" href="http://www.yjq.cc/member/message/index">消息'+msg_new+''; //$txt+= '个人中心'; }else{ $txt = '登录'; $txt+= '免费注册'; } $("#loginstatus").html($txt); }); //二级导航 var offsetLeft = new Array(); var windowWidth = $(window).width(); function get_width(){ windowWidth = $(window).width(); //设置"down-nav"宽度为浏览器宽度 $(".down-nav").width($(window).width()); $(".st-menu li").hover(function(){ var liWidth = $(this).width()/2; $(this).addClass("this-hover"); offsetLeft = $(this).offset().left; $(this).children(".down-nav").css("left",-offsetLeft); offsetLeft = $(this).offset().left; //获取当前选中li下的sub-list宽度 var nav_left = $(this).parents(".wm-1200:first").offset().left; var nav_width=$(this).parents(".wm-1200:first").width(); var nav_right= nav_left+nav_width; var sub_list_width = $(this).children(".down-nav").children(".sub-list").width(); if(sub_list_width>nav_width) sub_list_width=nav_width; var sub_list_left=offsetLeft-sub_list_width/2+liWidth; var sub_list_right=sub_list_left+sub_list_width; $(this).children(".down-nav").children(".sub-list").css("width",sub_list_width); $(this).children(".down-nav").children(".sub-list").css("left",sub_list_left); if(sub_list_leftnav_right) { $(this).children(".down-nav").children(".sub-list").css("left",nav_right-sub_list_width); } // alert(nav_left); /* var offsetRight = windowWidth-offsetLeft; var side_width = (windowWidth - 1200)/2; if(sub_list_width > offsetRight){ $(this).children(".down-nav").children(".sub-list").css({"right":side_width,"left":offsetLeft-sub_list_width/2+liWidth,"width":"auto"}); } if(side_width > offsetLeft-sub_list_width/2+liWidth){ $(this).children(".down-nav").children(".sub-list").css({"right":side_width,"left":side_width,"width":"auto"}); } */ },function(){ $(this).removeClass("this-hover"); }); }; $(window).resize(function(){ get_width(); }); get_width(); //选中导航 var typeid = "12"; if(typeid!=''){ $('.nav_header_'+typeid).addClass('active'); } //超出的栏目隐藏 var maxWidth = 0; var primaryMenuLi = $(".st-menu>ul>li"); for(i=0;i980){ $(primaryMenuLi[i]).hide() } } })
  • 价格透明,安心咨询
  • 品质保证,放心出行
  • 产品丰富,一站式服务
  • 专业户外,24小时客服