87,992
社区成员
发帖
与我相关
我的任务
分享
$(document).ready(function(){
if(getCookie() != null){
var indexValue = getCookie();
alert(indexValue)
$(".rightnavlist li ul").hide();
$(".rightnavlist").children("li:eq("+indexValue+")").find(".text").show();//如果cookies存在,则输出cookIe
}
})
点击链接的时候响应setCookie函数,我在setCookie函数里弹出COOKIE也是正常的,但是在$(document).ready中弹出的却是旧的值
//获取Cookie
function getCookie(){
var indexValue = $.cookie("navid");
return indexValue;
}
//存入Cookie
function setCookie(indexValue){
$.cookie("navid",indexValue);
return true;
}