All Posts by Email, Once a Week

Media Temple logo

CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.

slideToggle and cookies

  • # March 2, 2009 at 3:01 pm


    im using the following code in my side navigation, the problem is when i click on one of the links, the page gets reloaded on the "tree" snaps back to its initial state which is closed. can someone help me to integrate the cookie plugin so it’d save the current state in a cookie, so when the page gets reloaded it would still stay open as long you’re within the "sub tree".

    here’s my code and the plugin im trying to use.

    $(document).ready(function() {
    // hides the filterpanel as soon as the DOM is ready
    $(‘ul#menu li ul’).hide();

    // toggles the filterpanel on clicking the noted link
    $(‘ul#menu li a’).click(function(){
    $(‘ul#menu li ul’).slideToggle(‘normal’);

    return false;

    thanks for your help.


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed