I'm trying to use jQuery to toggle the appearance of a shoutbox and remember that state from page to page. My problem is getting the cookie that remembers the state set. Here's the code I've come up with so far, but it doesn't seem to be executing the if
statement correctly. Any ideas why?
function show_shoutbox()
{
$('#SB').toggle("fast");
if ( $('#SB').css('display') =="none")
{ document.cookie = "displaysb=false;"; }
else
{ document.cookie = "displaysb=true; ";}
}
My experience with Javascript and jQuery is minimal, so I apologize if this is a stupid question.