前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >animate.css+wow.js实现网页动画

animate.css+wow.js实现网页动画

作者头像
明知山
发布2020-09-03 10:49:37
2.6K0
发布2020-09-03 10:49:37
举报
文章被收录于专栏:前端开发随笔前端开发随笔
代码语言:javascript
复制
<!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>animate动画</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/animate.css/3.7.2/animate.min.css">

</head>
<style>
    .wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 200px;
        flex-wrap: wrap;
        width: 1200px;
        margin: auto;
    }

    .wrap div {
        width: 260px;
        height: 260px;
        border-radius: 50%;
        background: lightseagreen;
        margin: 50px;
    }

    .btn {
        width: 200px;
        height: 50px;
        text-align: center;
        line-height: 50px;
        background: lightseagreen;
        color: #fff;
        cursor: pointer;
        animation-duration: 2s;
        animation-delay: 300ms;
        animation-iteration-count: infinite;
        animation-name: pulse;
    }
</style>

<body>
    <div class="btn">点击动画</div>
    <div class="wrap">
        <div id="one" class="wow bounceInDown"></div>
        <div class="wow zoomInDown"></div>
        <div class="wow flipInY"></div>
        <div class="wow pulse"></div>
        <div class="wow rubberBand"></div>
        <div class="wow shake"></div>
        <div class="wow swing"></div>
        <div class="wow tada"></div>
        <div class="wow wobble"></div>
        <div class="wow jello"></div>
        <div class="wow heartBeat"></div>
        <div class="wow bounceInRight"></div>
    </div>
</body>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/wow/0.1.11/wow.min.js"></script>
<script>
    $(function () {
        // 初始化wow
        new WOW().init();
        $.fn.extend({
            animateCss: function (animationName) {
                var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
                $(this).addClass('animated ' + animationName).one(animationEnd, function () {
                    $(this).removeClass('animated ' + animationName);
                });
            }
        });
        $('.btn').on('click', function () {
            $('.wrap').animateCss('bounceInUp');
        });
    });
</script>

</html>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-11-28 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档