码迷,mamicode.com
首页 > Web开发 > 详细

CSS3 动画

时间:2015-04-28 22:26:10      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:

<!doctype />
<html>
<head>
<style type="text/css">
.aa
{
width: 200px;
height: 200px;
background: red;
border-radius: 5px;
position:absolute;
-webkit-transform:rotateY(90deg);
-o-transform:rotateY(90deg);
-moz-transform:rotateY(90deg);
transform:rotateY(90deg);
/* -moz-animation:myfirst 5s;
-o-animation:myfirst 5s; */
}
.bb
{
width: 200px;
height: 200px;
background: yellow;
border-radius: 5px;
position:relative;

}

.cc
{
width: 200px;
height: 200px;
background: red;
border-radius: 5px;
-webkit-animation:myfirst .3s linear 0ms 1 normal forwards;
-moz-animation:myfirst .3s linear 0ms 1 normal forwards;
-o-animation:myfirst .3s linear 0ms 1 normal forwards;
animation:myfirst .3s linear 0ms 1 normal forwards;
}
.dd
{
width: 200px;
height: 200px;
background: red;
border-radius: 5px;
-webkit-animation:my .3s linear 0ms 1 normal forwards;
-moz-animation:my .3s linear 0ms 1 normal forwards;
-o-animation:my .3s linear 0ms 1 normal forwards;
animation:my .3s linear 0ms 1 normal forwards;
}

@keyframes myfirst
{
0%
{
transform:rotateY(-90deg);
transform-origin:0;
}
100%
{
transform:rotateY(0deg);
transform-origin:0;
}
}
@-webkit-keyframes myfirst
{
0%
{
transform:rotateY(-90deg);
transform-origin:0;
}
100%
{
transform:rotateY(0deg);
transform-origin:0;
}
}
@-o-keyframes myfirst
{
0%
{
transform:rotateY(-90deg);
transform-origin:0;
}
100%
{
transform:rotateY(0deg);
transform-origin:0;
}
}
@-moz-keyframes myfirst
{
0%
{
transform:rotateY(-90deg);
transform-origin:0;
}
100%
{
transform:rotateY(0deg);
transform-origin:0;
}
}





@keyframes my
{
0%
{
transform:rotateY(0deg);
transform-origin:0;
}
100%
{
transform:rotateY(90deg);
transform-origin:0;
}
}
@-webkit-keyframes my
{
0%
{
transform:rotateY(0deg);
transform-origin:0;
}
100%
{
transform:rotateY(90deg);
transform-origin:0;
}
}
@-o-keyframes my
{
0%
{
transform:rotateY(0deg);
transform-origin:0;
}
100%
{
transform:rotateY(90deg);
transform-origin:0;
}
}
@-moz-keyframes my
{
0%
{
transform:rotateY(0deg);
transform-origin:0;
}
100%
{
transform:rotateY(90deg);
transform-origin:0;
}
}
</style>
</head>
<body>
<div class="bb" id="a">
<div class="aa" id="abc">
<img src="12.png" width="100" height="100" />
</div>
</div>
<script type="text/javascript">

document.getElementById("a").onmousemove = function () {
document.getElementById("abc").className = "cc";
}
document.getElementById("abc").onmouseout = function () {
document.getElementById("abc").className = "dd";
}

</script>
</body>
</html>

CSS3 动画

标签:

原文地址:http://www.cnblogs.com/hank-chen/p/4464063.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!