I'm developing a WordPress theme that allows users to toggle the visibility of the sidebars using Javascript in the same way that wikis allow users to show or hide a table of contents.
When a user clicks the link to hide a sidebar I have a toggle() javascript toggle function that sets the visibility of the sidebar to "none" and also sets a document cookie so that the next time the users visits that page, the sidebar will remember the last toggle state.
I have another javascript function setToggleFromCookie() that gets the cookie and sets the visibility based on that cookie. This all works except:
If a sidebar is hidden (i.e. visibility of the sidebar div = "none" and the document cookie hidesidebar = 1), when the page is loaded, the sidebar appears briefly before the javascript overrides the visibility = "block" with visibility = "none."
I have put setToggleFromCookie() in jQuery(document).ready(function(), but the page still seems to load and display the sidebar BEFORE setToggleFromCookie() jumps in to hide it...
