标签:
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title>CSS3平滑过渡transition</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<script src="js/jquery-1.10.2.js"></script>
<style>
#timings-demo {
border: 1px solid #ccc;
padding: 10px;
height: 400px;
width: 400px;
}
.demo-box {
width: 100px;
height: 50px;
text-align: center;
line-height: 50px;
text-align: center;
color: #fff;
background: #96c;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: inset 0 0 5px rgba(102, 153, 0,0.5);
-webkit-box-shadow: inset 0 0 5px rgba(102, 153, 0,0.5);
box-shadow: inset 0 0 5px rgba(102, 153, 0,0.5);
margin-bottom: 10px;
}
#ease {
-moz-transition: all 5s ease 0.3s;
-webkit-transition: all 5s ease 0.3s;
-o-transition: all 5s ease 0.3s;
transition: all 5s ease 0.3s;
background: #f36;
}
#ease-in{
-moz-transition:all 3s ease-in 0.5s;
-webkit-transition: all 3s ease-in 0.5s;
-o-transition:all 3s ease-in 0.5s;
transition:all 3s ease-in 0.5s;
background: #369;
}
#ease-out{
-moz-transition:all 5s ease-out 0s;
-webkit-transition:all 5s ease-out 0s;
-o-transition:all 5s ease-out 0s;
transition:all 5s ease-out 0s;
banckground:#636;
}
#ease-in-out{
-moz-transition: all 1s ease-in-out 2s;
-webkit-transition: all 1s ease-in-out 2s;
-o-transition: all 1s ease-in-out 2s;
transition: all 1s ease-in-out 2s;
background: #3e6;
}
#linear{
-moz-transition:all 6s linear 0s;
-webkit-transition:all 6s linear 0s;
-o-transition:all 6s linear 0s;
transition:all 6s linear 0s;
background: #999;
}
#cubic-bezier{
-moz-transition: all 4s cubic-bezier 1s;
-webkit-transition: all 4s cubic-bezier 1s;
-o-transition: all 4s cubic-bezier 1s;
transition: all 4s cubic-bezier 1s;
background: #6d6;
}
.timings-demo-hover,#timings-demo:hover .demo-box{
-moz-transform: rotate(360deg) scale(1.2);
-webkit-transform:rotate(360deg) scale(1.2);
-moz-transform: rotate(360deg) scale(1.2);
transform:rotate(360deg) scale(1.2);
background: #369;
border: 1px solid rgba(255,230,255,08);
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
margin-left: 280px;
height: 30px;
line-height: 30px;
margin-bottom: 15px;
}
</style>
</head>
<body>
<a id="timings-demo-btn">click</a>
<div id="timings-demo">
<div id="ease" class="demo-box">Ease</div>
<div id="ease-in" class="demo-box">Ease-in</div>
<div id="ease-out" class="demo-box">Ease-out</div>
<div id="ease-in-out" class="demo-box">Ease-in-out</div>
<div id="linear" class="demo-box">Linear</div>
<div id="cubic-bezier" class="demo-box">Cubic-bezier</div>
</div>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/lily2015/p/4661617.html