C
ca
I'm using about 30 blocks with links on my page, that can be opened or
closed by users so they're able to select which links should be
displayed on their 'personal' page.
Just closing blocks for the first time works fine, but returning
visitors that want to open or close a new block, lose their first
setting, everything in the cookie is replaced.
I use this code, anyone got an idea? I spent days figuring it out! It
drives me crazy!
function toggle(t) {
var para=document.getElementById(t);
var tb = document.getElementById('t' + t);
var htb = document.getElementById('h' + t);
var v = GetCookieOpenClose('l');
if(para.style.display!='none') {
para.style.display = 'none';
tb.style.display = 'block';
htb.style.display = 'none';
if (v!=null) {
v += "|" + t;
} else {
v = "|" + t;
}
SetCookieOpenClose('l',v);
}
else {
para.style.display = 'block';
tb.style.display = 'none';
htb.style.display = 'block';
if (v!=null) {
v = v.Replace("|" + t,"");
}
SetCookieOpenClose('l',v);
}
v = GetCookieOpenClose('l');
return true;
}
closed by users so they're able to select which links should be
displayed on their 'personal' page.
Just closing blocks for the first time works fine, but returning
visitors that want to open or close a new block, lose their first
setting, everything in the cookie is replaced.
I use this code, anyone got an idea? I spent days figuring it out! It
drives me crazy!
function toggle(t) {
var para=document.getElementById(t);
var tb = document.getElementById('t' + t);
var htb = document.getElementById('h' + t);
var v = GetCookieOpenClose('l');
if(para.style.display!='none') {
para.style.display = 'none';
tb.style.display = 'block';
htb.style.display = 'none';
if (v!=null) {
v += "|" + t;
} else {
v = "|" + t;
}
SetCookieOpenClose('l',v);
}
else {
para.style.display = 'block';
tb.style.display = 'none';
htb.style.display = 'block';
if (v!=null) {
v = v.Replace("|" + t,"");
}
SetCookieOpenClose('l',v);
}
v = GetCookieOpenClose('l');
return true;
}