Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript slideToggle and cookies

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #24261
    svnlto
    Member

    hi,

    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.

    Code:
    $(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 h2.works’).click(function(){
    $(‘ul#menu li ul’).slideToggle(‘normal’);

    return false;
    });
    });

    http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/

    thanks for your help.

    sven

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.