Overriding toggle()

Overriding toggle()

I have developed vertical navigation with sub menus that slideDown and slideUp when clicking the heading using toggle().  All sub menus begin closed when the page is opened.

However, when a visitor is on a page that is within a menu then I want that menu to be open when the page is opened.  So far, so good.

The problem I am having is that when one clicks on that particular open menu item to close it, nothing happens.  This is because the action of toggle() is to open the already opened menu.  The visitor needs to click a second time to actually close the menu item.

Is there any way of dealing with this, or do I need to not use toggle() and write my own function based on the open/close status of the menu?

Thanks -

george