I have a question about a simple jQuery accordion I found.
I'd like to use Font Awesome icons to indicate the active/inactive state with plus and minus icons. In my JSFiddle you see the accordion titles with plus icons. When you click on a title the "fa-plus" class needs to change to "fa-minus".
I already did some tests with add and removeClass, but I couldn't get it working. I'm really a jQuery/javascript noob! Hope you guys can help me out :-).
jQuery('.accordion dt').click(function() {
jQuery('.accordion dt').removeClass('active');
jQuery('.accordion_content').slideUp('normal');
if(jQuery(this).next().is(':hidden') == true) {
jQuery(this).addClass('active');
jQuery(this).next().slideDown('normal');
}
});
jQuery('.accordion_content').hide();