+/- sign does not toggle
Opened this issue · 0 comments
steven266 commented
Hi,
I used your code and everything works fine - except for the signs which do not change after the first time (from '+' to '-', but won't change back).
I wrote a fix for that:
$(function () {
$('fieldset.collapsible > legend').append(' (<span style="font-family: monospace;">+</span>)');
$('fieldset.collapsible > legend').click(function () {
var $divs = $(this).siblings();
$divs.toggle();
$(this).find('span').text(function () {
return ($divs.first().is(':visible')) ? '+' : '-';
});
});
});
Best regards
Steven