[thelist] JavaScript + CSS to Toggle Menu List

Lee kowalkowski lee.kowalkowski at googlemail.com
Sat Aug 12 17:28:28 CDT 2006


On 11/08/06, ibn Ezra <ibnezra at mac.com> wrote:
> Help!
> (and even better close the others in the menu -- beyond the scope of
> what I have so far) and use the cookies to preserve the current state
> so that the menu doesn't close back up again when loading a new page.
>
> What am I doing wrong?

The cookie data is not being managed properly (by the JS).  The
getCookie function looks alright, but when you do a document.cookie =
"news=show".  It doesn't replace "news=hide", this results in a cookie
with both "news=show" and "news=hide" inside.  Perhaps a
document.cookie="news=;expires=-1" is required before a
document.cookie="news=show".  Not sure why that's happening, sorry.

The getCookie function prefers the "news=hide" because it starts with
a semi-colon, and it looks for this first.

Because you only want one "sheet" open at any time, just put one value
in your cookie, "show=<<id>>".

-- 
LK



More information about the thelist mailing list