• 模拟钟表的转动


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>练习</title>
        
    </head>
    <style type="text/css">
        * {
        margin: 0;
        padding: 0;
    }
    @keyframes minute {
        from {
            transform: rotate(0deg);
        }
        to {
            transform: rotate(360deg);
        }
    }
    @keyframes second {
        from {
            transform: rotate(0deg);
        }
        to {
            transform: rotate(360deg);
        }    
    }
    .time {
         300px;
        height: 300px;
        border-radius: 50%;
        background: #F2D298;
        border:5px solid #F2D298;
        margin:0 auto;
        position: relative;
    }
    .minute {
         10px;
        height: 100px;
        background-color: #F4EBEB;
        position: absolute;
        left: 150px;
        top: 60px;
        /*ainimation:name duration timing-function delay iteration-count direction;*/
        animation: minute 3600s linear 0s infinite;
        transform-origin:5px bottom;
    }
    .second {
         7px;
        height: 140px;
        background-color: #F4EBEB;
        position: absolute;
        left: 2px;
        top: -40px;
        animation:second 60s linear 0s infinite;
        transform-origin:2px bottom;
    }
    </style>
    <body>
    <!-- 实现钟表动画 -->
        <div class="time">
            <div class="minute">
                <div class="second"></div>
            </div>
        </div>
    </body>
    </html>

    以上是使用简单的css3动画实现的,有兴趣的朋友可以完善下,欢迎指点

  • 相关阅读:
    RESTful风格的API
    案例:toDoList
    jQuery中的Ajax
    php 使用kafka
    crontab不执行
    php两种实现守护进程的方式
    crontab不执行脚本,手动调测又没有任何问题
    centos7 安装跳板机(堡垒机)
    Ubuntu修改默认键盘布局的方法
    openresty nginx升级版
  • 原文地址:https://www.cnblogs.com/cheerping/p/7497101.html
Copyright © 2020-2023  润新知