I have a plugin set up to handle the CSS3 attribute. It currently rotates 45 degrees when clicked, but doesn't rotate back when clicked again to hide the content. Any ideas on how to fix this?
$("#faq dt").click(function() {
$(this).next('dd').slideToggle('fast');
if ($(this).next('dd').is(':visible')) {
$(this).children('span').transition({ rotate: '45deg' });
}
else {
$(this).children('span').transition({ rotate: '-45deg' });
}
});
You can check out the live site here:
UPDATED SNIPPET:
$("#faq dt").click(function() {
$(this).next('dd').slideToggle('fast', function() {
if ($(this).is(':visible')) {
$(this).prev('dt').children('span').transition({ rotate: '45deg' });
} else {
$(this).prev('dt').children('span').transition({ rotate: '0deg' });
}
});
});