<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<style>
.recuadro {width:100px;height:100px;border:1px solid #ccc;margin:5px;}
#color1 {background:#597326;}
.color1 {
background-color:#597326;
transition: background 1s cubic-bezier(0, .5, 1, .5);
-webkit-transition: background 1s cubic-bezier(0, .5, 1, .5);
-moz-transition: background 1s cubic-bezier(0, .5, 1, .5);
-o-transition: background 1s cubic-bezier(0, .5, 1, .5);
-ms-transition: background 1s cubic-bezier(0, .5, 1, .5);
}
#color2 {background:#d00;}
.color2 {
background-color:#d00;
transition: background 1s cubic-bezier(0, .5, 1, .5);
-webkit-transition: background 1s cubic-bezier(0, .5, 1, .5);
-moz-transition: background 1s cubic-bezier(0, .5, 1, .5);
-o-transition: background 1s cubic-bezier(0, .5, 1, .5);
-ms-transition: background 1s cubic-bezier(0, .5, 1, .5);
}
#color3 {background:yellow;}
.color3 {
background-color:yellow;
transition: background 1s cubic-bezier(0, .5, 1, .5);
-webkit-transition: background 1s cubic-bezier(0, .5, 1, .5);
-moz-transition: background 1s cubic-bezier(0, .5, 1, .5);
-o-transition: background 1s cubic-bezier(0, .5, 1, .5);
-ms-transition: background 1s cubic-bezier(0, .5, 1, .5);
}
#color4 {background:#00aaff;}
.color4 {
background-color:#00aaff;
transition: background 1s cubic-bezier(0, .5, 1, .5);
-webkit-transition: background 1s cubic-bezier(0, .5, 1, .5);
-moz-transition: background 1s cubic-bezier(0, .5, 1, .5);
-o-transition: background 1s cubic-bezier(0, .5, 1, .5);
-ms-transition: background 1s cubic-bezier(0, .5, 1, .5);
}
</style>
<script>
$(document).ready(function(){
$(".recuadro").click(function(){
$("body").removeClass().addClass($(this).attr("id"));
})
})
</script>
<title>Ejemplo utilización transition cubic-bezier</title>
</head>
<body>
<h1>Ejemplo utilización transition cubic-bezier</h1>
<div class="recuadro" id="color1" style="background:#597326"></div>
<div class="recuadro" id="color2" style="background:#d00;"></div>
<div class="recuadro" id="color3" style="background:yellow;"></div>
<div class="recuadro" id="color4" style="background:#00aaff;"></div>
<p><a href="http://www.lawebdelprogramador.com/">http://www.lawebdelprogramador.com/</a></p>
</body>
</html>