Actually it seems to me that to turn persistence off goes against the idea of wanting the menu to follow the user.
How about this...
Code:
function restore() {
if(getcookie("menu") != null) {
var hidden = getcookie("menu").split(",");
for(var i in hidden) {
titles[hidden[i]].className = "titlehidden";
submenus[hidden[i]].style.height = "0px";
submenus[hidden[i]].style.display = "none";
arrows[hidden[i]].src = "media/collapsed.gif";
}
}
else if (contractall_default) //DD added code
slash_contractall() //DD added code
}
Put the slash_contractall into the restore function. That way if the Menu cookie is null, it contracts the menu. If the Menu cookie is not null, it leaves persistance as it is.
Thoughts? This seems to work for me.
Bookmarks