This function adds a rotated class to my button when I click it. The button has an arrow on it which points in the direction the panel has slid.
rotated
How co
You can use .toggleClass()
.toggleClass()
$('#btnDiv').toggleClass('rotated');
That adds it if it's missing, and removes it if it's present. There's also .is() to check for things like that:
.is()
if ($('#btnDiv').is('.rotated'))
or more simply:
if ($('#btnDiv').hasClass('rotated'))