To achieve the desired effect, consider adding the jquery library along with jquery ui, and utilizing the switchClass function.
For detailed instructions, refer to: http://jqueryui.com/demos/switchClass/
You can accomplish this in just 5 lines of code:
Incorporate jquery and jquery ui into the head section of your webpage (2 lines of code). These are externally hosted files that can be easily copied and pasted:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
Subsequently, at the bottom of the body section, include a script containing the following three lines:
$(".yourbutton").click(function() {
switchClass('.currentclass','.redclass',500)
// transition from .currentclass to .redclass in 500 milliseconds
});