• The option to use a cookie to remember the user’s place in the menu is a great feature. However, there are times when I want the menu to reset to being completely closed, like when the user goes back to the home page, for example. It looks cleaner to always have the menu on the home page reset to its closed position rather than having it remember where the user previously was.

    Is there a way to make an exception on a specific page to the menu’s state being saved? Maybe a way to clear the cookie on the loading of the home page?

    https://www.ads-software.com/extend/plugins/jquery-vertical-accordion-menu/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author remix4

    (@remix4)

    hi,

    the plugin doesnt have this feature. You could use jQuery to clear the cookie though and add it to specific pages. Use the following code to reset the cookie:

    $.cookie(cookieId, ”, { path: ‘/’ });

    change the “cookieId” for your specific cookie ID – this can be found in the jquery code in the footer of the page and looks something like:

    cookie: ‘dc_jqaccordion_widget-3’

    Thread Starter johnnyquest

    (@johnnyquest)

    Hi remix,

    Thanks for the suggestion. I’m not very good with jQuery; I tried inserting this code but couldn’t seem to get it to work:

    <script type="text/javascript">
    	jQuery $.cookie(dc_jqaccordion_widget-6, '', { path: '/' });
    </script>

    Am I doing something wrong?

    Thread Starter johnnyquest

    (@johnnyquest)

    And is there anywhere in particular I should insert the code, other than in the page’s header?

    Plugin Author remix4

    (@remix4)

    You need to call the script as follows:

    <script type="text/javascript">
        jQuery(document).ready(function($) {
            $.cookie(dc_jqaccordion_widget-6, '', { path: '/' });
        });
    </script>

    location is not critical

    Thread Starter johnnyquest

    (@johnnyquest)

    Hmm, this seems to be breaking the accordion menu entirely. It closes it, but is also prevents it from expanding when I click on the links.

    Plugin Author remix4

    (@remix4)

    It shouldnt unless there is an error in the code. All the above code should do is reset the cookie

    Thread Starter johnnyquest

    (@johnnyquest)

    I do have another plugin on the page that uses jQuery; maybe there’s some kind of conflict?

    Plugin Author remix4

    (@remix4)

    If the other plugin incorrectly loads jquery this would stop the menu from working. If you check the source code you can check for other instances of jquery.

    You can check if there are any javascript errors using Firebug

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: JQuery Accordion Menu Widget] Keeping menu closed on certain pages?’ is closed to new replies.