美文网首页
跳动的小球

跳动的小球

作者: zkzhengmeng | 来源:发表于2020-11-29 10:09 被阅读0次

复制下方代码即可查看使用

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
            .wrap {
                width: 150px;
                height: 300px;
                position: absolute;
                left: 50%;
                top: 50%;
                margin: -150px 0 0 -75px;
            }

            .ball {
                width: 100px;
                height: 100px;
                border-radius: 50%;
                background:red;
                position: absolute;
                z-index: 99;
                animation: bounce 1s infinite linear;
                -webkit-animation: bounce 1s infinite linear;
                -moz-animation: bounce 1s infinite linear;
                -o-animation: bounce 1s infinite linear;
            }

            @-webkit-keyframes bounce {
                0% {
                    top: 0;
                    -webkit-animation-timing-function: ease-in;
                }

                40% {}

                50% {
                    top: 180px;
                    -webkit-animation-timing-function: ease-out;
                    -webkit-transform: scale(1);
                }

                55% {
                    top: 200px;
                    -webkit-transform: scale(1, 0.65);
                    -webkit-animation-timing-function: ease-in;
                }

                65% {
                    top: 160px;
                    -webkit-transform: scale(1);
                    -webkit-animation-timing-function: ease-out;
                }

                95% {
                    top: 0;
                    -webkit-animation-timing-function: ease-in;
                }

                100% {
                    top: 0;
                    -webkit-animation-timing-function: ease-in;
                }
            }

        </style>
    </head>
    <body>
        <div class="wrap">
            <div class="ball">
            </div>
        </div>
    </body>
</html>

相关文章

网友评论

      本文标题:跳动的小球

      本文链接:https://www.haomeiwen.com/subject/cqhrwktx.html