zoukankan      html  css  js  c++  java
  • 动画01

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    
        <style>
            *{
                margin: 0;
                padding: 0;
            }
    
            .box1{
                 800px;
                height: 800px;
                background-color: silver;
                overflow: hidden;
            }
    
            .box1 div{
                 100px;
                height: 100px;
                margin-bottom: 100px;
                margin-left: 10px;
                
            }
    
            .box2{
                background-color: #bfa;
                
    
                /* 设置box2的动画 */
                /* animation-name: 要对当前元素生效的关键帧的名字 */
                /* animation-name: test; */
    
                /* animation-duration: 动画的执行时间 */
                /* animation-duration: 4s; */
    
                
    
                /* 动画的延时 */
                /* animation-delay: 2s; */
    
                /* animation-timing-function: ease-in-out; */
    
                /* 
                animation-iteration-count 动画执行的次数 
                    可选值:
                        次数
                        infinite 无限执行
                */
                /* animation-iteration-count: 1; */
    
                /*
                 animation-direction
                    指定动画运行的方向
                        可选值:
                        normal 默认值  从 from 向 to运行 每次都是这样 
                        reverse 从 to 向 from 运行 每次都是这样 
                        alternate 从 from 向 to运行 重复执行动画时反向执行
                        alternate-reverse 从 to 向 from运行 重复执行动画时反向执行
    
                */
                /* animation-direction: alternate-reverse; */
    
                /* 
                    animation-play-state: 设置动画的执行状态 
                    可选值:
                        running 默认值 动画执行
                        paused 动画暂停
                */
                /* animation-play-state: paused; */
    
                /* 
                animation-fill-mode: 动画的填充模式
                    可选值:
                        none 默认值 动画执行完毕元素回到原来位置
                        forwards 动画执行完毕元素会停止在动画结束的位置
                        backwards 动画延时等待时,元素就会处于开始位置
                        both 结合了forwards 和 backwards
                */
                /* animation-fill-mode: both; */
                animation: test 2s 2 1s alternate;
    
                
            }
    
            .box1:hover div{
                animation-play-state: paused;
            }
    
            /* 
            动画
                动画和过渡类似,都是可以实现一些动态的效果,
                    不同的是过渡需要在某个属性发生变化时才会触发
                    动画可以自动触发动态效果
                    
                设置动画效果,必须先要设置一个关键帧,关键帧设置了动画执行每一个步骤
            */
            @keyframes test {
                /* from表示动画的开始位置 也可以使用 0% */
                from{
                    margin-left: 0;
                    background-color: orange;
                } 
    
                /* to动画的结束位置 也可以使用100%*/
                to{
                    background-color: red;
                    margin-left: 700px;
                }
            }
        </style>
    
    </head>
    <body>
    
        <div class="box1">
            <div class="box2"></div>
            <!-- <div class="box3"></div> -->
        </div>
        
    </body>
    </html>
    
  • 相关阅读:
    java pojo类
    web(一)
    java通过配置文件(Properties类)连接Oracle数据库代码示例
    java数组排序(插入排序、冒泡排序、选择排序)与递归 代码示例
    匿名内部类
    java反射机制
    ubuntu安装kvm流程
    squid代理服务问答
    ftp nfs samba比较
    Samba服务问答
  • 原文地址:https://www.cnblogs.com/anyux/p/14715962.html
Copyright © 2011-2022 走看看