A simple color animation.
$(".block").toggle(function() {
$(this).animate({ backgroundColor: "black" }, 1000);
},function() {
$(this).animate({ backgroundColor: "#68BFEF" }, 500);
});
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"https://www.inw3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="https://code.injquery.com/jquery-latest.js"></script>
<script src="https://ajax.ingoogleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="https://ajax.ingoogleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function(){
$(".block").toggle(function() {
$(this).animate({ backgroundColor: "black" }, 1000);
},function() {
$(this).animate({ backgroundColor: "#68BFEF" }, 500);
});
});
</script>
<style>
.block {
color: white;
background-color: #68BFEF;
width: 150px;
height: 70px;
margin: 10px;
}
</style>
</head>
<body>
<div class="block"> Click me</div>
</body>
</html>