I have a piece of code that toggles open parts of <ul> when you click on a PLUS sign. And then it closes again, when it is clicked. There are many of these on a large menu. What I would like to add to the script is that if you click on a PLUS sign and there are other plus sigs that have been toggled open, they will close, so only one one toggled are is open at a time. The following script opens the ul but then it closes it again right away. Can anyone help me sort this out?
var $sublinks = $('.sublinks');
var text = ($(this).text() == '+') ? '-' : '+';
var $ans = $(this).next(".sublinks").stop(true).slideToggle(100);