scrollReveal实现网页重复动画效果

放肆的年华 提交于 2020-01-02 18:29:25

文档链接

<!doctype html>
<html lang="zh-CN">

<head>
    <title>scrollReveal.js</title>
    <meta charset="utf-8">
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .row {
            display: flex;
            align-items: center;
            justify-content: space-around;
            flex-wrap: wrap;
            width: 500px;
            margin: auto;
        }

        .row div {
            margin: 20px;
            width: 100px;
            height: 300px;
            background: lightseagreen;
        }
    </style>
</head>

<body>
    <div class="row">
        <div data-scroll-reveal="enter top"></div>
        <div data-scroll-reveal="enter left"></div>
        <div data-scroll-reveal="enter right"></div>
        <div data-scroll-reveal="enter bottom"></div>
        <div data-scroll-reveal="enter top over 1s"></div>
        <div data-scroll-reveal="enter left after 1s"></div>
        <div data-scroll-reveal="enter right and move 50px"></div>
        <div data-scroll-reveal="enter bottom over 1s after 1s and move 50px"></div>
        <div data-scroll-reveal="enter top  and move 300px after 0.3s"></div>
        <div data-scroll-reveal="enter left over 1s and move 50px after 0.3s"></div>
        <div data-scroll-reveal="enter right over 1s after 1s and move 50px after 0.3s"></div>
        <div data-scroll-reveal="enter bottom over 1s after 1s and move 50px after 0.3s  over 1s"></div>
    </div>
</body>
<script src="https://cdn.bootcss.com/scrollReveal.js/0.1.1/scrollReveal.min.js"></script>
<script>
    (function () {
        window.scrollReveal = new scrollReveal({ reset: true });
    })();
</script>

</html>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!