[eluser]IamPrototype[/eluser]
Hey boys and girls. On my website I'd like to have a sidebar, but the sidebar shouldn't be visible at first visit. If you want to see the sidebar, click "Show Sidebar", save a cookie with the value "expanded"..blablabla.. you get the points, right?
Well, I've downloaded a jQuery cookie plugin and I've the newest jQuery version. My problem is that the plugin won't save my cookies! My jQuery script looks like this.
Code:
$(document).ready(function()
{
$("#right_content").hide();
$("#sidebar_toggle").click(function()
{
if ($("#right_content").is(":hidden")) {
$("#right_content").slideDown("slow");
$.cookie("showSidebar", "collapsed");
return false;
} else {
$("#right_content").slideUp("slow");
$.cookie("showSidebar", "expanded");
return false;
}
var showSidebar = $.cookie("showSidebar");
if (showSidebar == "collapsed") {
$("#right_content").hide();
} else {
$("#right_content").show();
}
});
});
NOTE: The toggler works perfectly, it just doesn't save my cookie and the sidebar state! Any help?