If you want to store something like that in the browser between page loads a good way to do that is with a cookie. With a cookie you can set and get the current state of the menu and it will carry over between page loads.
You can find more details at http://plugins.jquery.com/project/Cookie
I'm trying to use jQuery to make nested HTML lists expandable and collapsable, but need some help...
The code I have is currently running from a
$(document).ready()function and as a result my menu/list is being reset at every page load (collapsed back to normal). How do I make my menu stay expanded between page loads?Here's the code I'm using:
$(document).ready(function() {
// Hide all child links by default
$('#pondering-archives ul').hide();
// Display child links when parent link is clicked
$('#pondering-archives .title').click(function() {
$(this).siblings('ul').slideToggle(500);
});
});
Thanks!