$txt+= '退出';
//$txt+= '个人中心';
$('.message').addClass('top-new-msg');
user_mid = data.user.mid;
var phpfile = 'll_tk11257_pc_no296_header/php/member.php';
var classname = 'member';
var method = 'message';
$.post(SITEURL+'dz/index',{phpfile:phpfile,classname:classname,method:method,user_mid:user_mid},function (info){
var status = info.num;
if(status){
$('.message').addClass('top-new-msg unread');
}else
{
$('.message').addClass('top-new-msg');
}
},'json');
}else{
$txt = '';
}
$(".login-info").html($txt);
}
})
$('.new-order-bar').hover(function(){
newOrderBar.stopAutoplay()
},function(){
newOrderBar.startAutoplay()
});
});
//导航的选中状态
$(".header-menu a").each(function(){
var url= window.location.href;
url=url.replace('index.php','');
url=url.replace('index.html','');
var ulink=$(this).attr("href");
if(url==ulink)
{
$(this).parents("li:first").addClass('active');
}
});
//选中导航
var typeid = "1";
if(typeid!=''){
$('.nav_header_'+typeid).addClass('active');
}
function get_width() {
var offsetLeft = new Array();
var windowWidth = $(window).width();
//设置"down-nav"宽度为浏览器宽度
$(".down-nav").width($(window).width());
$(".header-menu li").hover(function() {
var liWidth = $(this).width() / 2;
$(this).addClass("this-hover");
offsetLeft = $(this).offset().left;
//获取当前选中li下的sub-list宽度
var sub_list_width = $(this).children(".down-nav").children(".sub-list").width();
$(this).children(".down-nav").children(".sub-list").css("width", sub_list_width);
$(this).children(".down-nav").css("left", -offsetLeft);
$(this).children(".down-nav").children(".sub-list").css("left", offsetLeft - sub_list_width / 2 + liWidth);
var offsetRight = windowWidth - offsetLeft;
var side_width = (windowWidth - 1200) / 2;
if(sub_list_width > offsetRight) {
$(this).children(".down-nav").children(".sub-list").css({
"left": offsetLeft - sub_list_width / 2 + liWidth,
"right": side_width,
"width": "auto"
});
}
if(side_width > offsetLeft - sub_list_width / 2 + liWidth) {
$(this).children(".down-nav").children(".sub-list").css({
"left": side_width,
"right": side_width,
"width": "auto"
});
}
}, function() {
$(this).removeClass("this-hover");
});
}