JSFiddle - React, Tailwind, and code Playground
http://stackoverflow.com/questions/7302824/animating-addclass-removeclass-with-jquery
by keif
HTML
<div id="test" class="blue"></div>
CSS
#test{
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
.blue{
background-color: blue;
width: 100px;
height: 100px;
}
.red{
background-color: red;
border: 3px solid black;
width: 150px;
height: 150px;
}
JavaScript
$('#test').click(function() {
$(this).toggleClass('red');
});