首页 > Web开发 > 详细

css3 使用animation实现动画效果

时间:2017-06-18 17:48:35      阅读:326      评论:0      收藏:0      [点我收藏+]
  .rotation {
            -webkit-animation-name: rotation;
            -webkit-animation-duration: 30s;
            -moz-animation-name: rotation;
            -moz-animation-duration: 30s;
        }

#sun {
    background: url("http://img.mukewang.com/55ade004000106c202010201.png") no-repeat;
    position: absolute;
    z-index: 1;
    top: -30px;
    height: 201px;
    width: 201px;
    right: 40%;

}

  @-webkit-keyframes rotation {

        0% {
    transform: translateX(0) translateY(0);
        }
100% {
    transform: translateX(-2000px) translateY(400px);
}
            /*?*/
        }
        
        @-moz-keyframes rotation {
            /*?*/
            0% {
    transform: translateX(0) translateY(0);
}
100% {
    transform: translateX(-2000px) translateY(400px);
}
        }

  

animation-name:是动画帧的设置 通过关键字keyframes 进行设置
duration设置动画完成的时间
本例中有一个div ID sum 显示一个太阳落山的效果


css3 使用animation实现动画效果

原文:http://www.cnblogs.com/ProDoctor/p/7044763.html

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