首页 > 其他 > 详细

Animation用法

时间:2016-06-09 23:33:18      阅读:363      评论:0      收藏:0      [点我收藏+]

测试代码及说明:

技术分享
<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>Simple CSS3 Animation</title>
    <style type="text/css">
        #demo {
            position: absolute;
            left: 30%;
            top: 30%;
            background-color: red;
            width: 200px;
            height: 200px;
            -webkit-animation: animation1 2s linear forwards; /*只有Webkit内核的浏览器才能解析*/
            -moz-animation: animation1 2s linear forwards; /*Firefox浏览器私有属性*/
            -o-animation: animation1 2s linear forwards; /*Opera浏览器私有属性*/
            -ms-animation: animation1 2s linear forwards; /*IE浏览器私有属性*/
            animation: animation1 2s linear forwards; /*Firefox浏览器私有属性*/
        }

        @-webkit-keyframes animation1 {
            0% {
                background: red;
            }

            50% {
                background: blue;
            }

            100% {
                background: yellow;
            }
        }

        @-moz-keyframes animation1 {
            0% {
                background: red;
            }

            50% {
                background: blue;
            }

            100% {
                background: yellow;
            }

        }

        @-o-keyframes animation1 {
            0% {
                background: red;
            }

            50% {
                background: blue;
            }

            100% {
                background: yellow;
            }

        }

        @-ms-keyframes animation1 {
            0% {
                background: red;
            }

            50% {
                background: blue;
            }

            100% {
                background: yellow;
            }
        }

        @keyframes animation1 {
            0% {
                background: red;
            }

            50% {
                background: blue;
            }

            100% {
                background: yellow;
            }

        }
    </style>
</head>
<body>
    <div id="demo">
    </div>
</body>
</html>
View Code

演示效果:

技术分享

 

Animation用法

原文:http://www.cnblogs.com/sccd/p/5571165.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!