Problem with collapsable menu
Hi,
I've got a UL which displays some categories.
I use this script to toggle subcategories on/off
- $('.wpsc_categories li').click(
- function() {
-
- var selectedItem = $(this);
- var submenu = $(this).find('ul');
-
-
-
- if (submenu.is(':visible'))
- {
- selectedItem.css({"background-image":"url(http://www.jendautos.nl/wp-content/uploads/wpsc/themes/default/images/ico_open.png)"});
- selectedItem.css({"background-repeat":"no-repeat"});
- //submenu.slideUp('normal');
-
-
- submenu.hide();
-
- }
- else if (submenu.is(':hidden'))
- {
- selectedItem.css({"background-image":"url(http://www.jendautos.nl/wp-content/uploads/wpsc/themes/default/images/ico_close.png)"});
- selectedItem.css({"background-repeat":"no-repeat"});
- //submenu.slideDown('normal');
- submenu.show();
- }
-
-
- }
-
-
- );
Problem is, that when I click on a link inside the subcategories, the submenu closes again.
It should ONLY close when you click on the "-" icon...
Anyone knows how to adjust the script, so that the submenu stays open after a click on a link?
Example can be found here: http://www.jendautos.nl/
(left sidebar)