I have an update button on which I want to pull attention when updating my content. I am doing this with an animation color fade and adding some arrow characters.
When the animation is finished I want my CSS :hover states back.
Is this possible or do I lose the original CSS and do I have to reset these with jQuery's hover()
Fiddle: http://jsfiddle.net/K6fd2/
CSS
a.btn { padding: 5px 20px; color: white; background-color: #4188FB; }
a.btn:hover { background: #FFCC00;}
HTML
<a href="#" class="btn">Update</a>
<br /><br />
<a href="#" class="change">change content</a>
JS
var oriBtnTxt = $(".btn").html(); // store original text
$(".change").click(function() {
$(".btn")
.css("background-color","#FFCC00")
.html(oriBtnTxt + " »")
.animate({backgroundColor: "#4188FB"}, 2000, "swing", function() {
// set back hover state
$("a.btn:hover").css("background-color", "#FFCC00");
});
})