zoukankan      html  css  js  c++  java
  • css3 使用animation实现动画效果

      .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;
         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 显示一个太阳落山的效果
    实际上这个和js定时器的功能类似 在指定的时间切换样式


  • 相关阅读:
    内置函数二
    通信的几个程序
    TCP协议和UDP协议
    异常处理
    logging模块
    网络编程一些概念
    hashlib
    序列化模块
    time,sys,os模块
    random模块
  • 原文地址:https://www.cnblogs.com/ProDoctor/p/7044763.html
Copyright © 2011-2022 走看看