css动画插件 - animation.css的基本使用

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>test</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/animate.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <style>
        .testa {
            -webkit-animation: bounceIn 1s 1s;
        }

        .testb {
            -webkit-animation: bounceIn 1s 2s;
        }

        .testc {
            -webkit-animation: bounceIn 1s 3s;
        }

        .testd {
            -webkit-animation: bounceIn 1s 4s;
        }
        dd:hover{
            cursor: pointer;
            color: orange;
        }
    </style>
</head>

<body>

    <div class="container">
        <div class="row">
            <br>
            <br>
            <div class="col-lg-3 testa">hello world</div>
            <div class="col-lg-3 testb">console.log</div>
            <div class="col-lg-3 testc">document.write</div>
            <div class="col-lg-3 testd">alert</div>
        </div>
        <br>
        <hr>
        <br>
        <!-- <div class="row">
            <input id="animationName" type="text">
            <button id="addBtn">addClass</button>
        </div> -->
        <div class="row">
            <div class="col-lg-12">
                <h2 id="test">HELLO WORLD</h2>
            </div>
            <br>
            <hr>
            <br>
            <div class="row">
                <div class="col-lg-3">
                    <dl>
                        <dt>Attention(晃动效果)</dt>
                        <dd>bounce</dd>
                        <dd>flash</dd>
                        <dd>pulse</dd>
                        <dd>rubberBand</dd>
                        <dd>shake</dd>
                        <dd>headShake</dd>
                        <dd>swing</dd>
                        <dd>tada</dd>
                        <dd>wobble</dd>
                        <dd>jello</dd>
                    </dl>
                </div>

                <div class="col-lg-3">
                    <dl>
                        <dt>bounce(弹性缓冲效果)</dt>
                        <dd>bounceIn</dd>
                        <dd>bounceInDown</dd>
                        <dd>bounceInRight</dd>
                        <dd>bounceInUp</dd>
                        <dd>bounceOut</dd>
                        <dd>bounceOutDown</dd>
                        <dd>bounceOutLeft</dd>
                        <dd>bounceOutRight</dd>
                        <dd>bounceOutUp</dd>
                    </dl>
                </div>
                <div class="col-lg-3">
                    <dl>
                        <dt>fade(透明度变化效果)</dt>
                        <dd>fadeIn</dd>
                        <dd>fadeInDown</dd>
                        <dd>fadeInDownBig</dd>
                        <dd>fadeInLeftBig</dd>
                        <dd>fadeInRight</dd>
                        <dd>fadeInRightBig</dd>
                        <dd>fadeInUp</dd>
                        <dd>fadeInUpBig</dd>
                        <dd>fadeOut</dd>
                        <dd>fadeOutDown</dd>
                        <dd>fadeOutDownBig</dd>
                        <dd>fadeOutLeft</dd>
                        <dd>fadeOutLeftBig</dd>
                        <dd>fadeOutRight</dd>
                        <dd>fadeOutRightBig</dd>
                        <dd>fadeOutUp</dd>
                        <dd>fadeOutUpBig</dd>
                    </dl>
                </div>
                <div class="col-lg-3">
                    <dl>
                        <dt>flip(翻转效果)</dt>
                        <dd>flipInX</dd>
                        <dd>flipInY</dd>
                        <dd>flipOutX</dd>
                        <dd>flipOutY</dd>
                    </dl>
                </div>
            </div>

            <div class="row">
                <div class="col-lg-3">
                    <dl>
                        <dt>rotate(旋转效果)</dt>
                        <dd>rotateIn</dd>
                        <dd>rotateInDownLeft</dd>
                        <dd>rotateInDownRight</dd>
                        <dd>rotateInUpLeft</dd>
                        <dd>rotateInUpRight</dd>
                        <dd>rotateOut</dd>
                        <dd>rotateOutDownLeft</dd>
                        <dd>rotateOutDownRight</dd>
                        <dd>rotateOutUpLeft</dd>
                        <dd>rotateOutUpRight</dd>
                    </dl>
                </div>
                <div class="col-lg-3">
                    <dl>
                        <dt>slide(滑动效果)</dt>
                        <dd>slideInDown</dd>
                        <dd>slideInLeft</dd>
                        <dd>slideInRight</dd>
                        <dd>slideInUp</dd>
                        <dd>slideOutDown</dd>
                        <dd>slideOutLeft</dd>
                        <dd>slideOutRight</dd>
                        <dd>slideOutUp</dd>
                    </dl>
                </div>
                <div class="col-lg-3">
                    <dl>
                        <dt>zoom(变焦效果)</dt>
                        <dd>zoomIn</dd>
                        <dd>zoomInDown</dd>
                        <dd>zoomInLeft</dd>
                        <dd>zoomInRight</dd>
                        <dd>zoomInUp</dd>
                        <dd>zoomOut</dd>
                        <dd>zoomOutDown</dd>
                        <dd>zoomOutLeft</dd>
                        <dd>zoomOutRight</dd>
                        <dd>zoomOutUp</dd>
                    </dl>
                </div>
                <div class="col-lg-3">
                    <dl>
                        <dt>special(特殊效果)</dt>
                        <dd>hinge</dd>
                        <dd>rollIn</dd>
                        <dd>rollOut</dd>
                        <dd>lightSpeedIn</dd>
                        <dd>lightSpeedOut</dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>

    <script>
        $(function () {
            // $("#addBtn").click(function () {
            //     var animationName = $("#animationName").val();
            //     $("#test").removeClass().addClass(animationName + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
            //         $(this).removeClass();
            //     })
            // })
            $("dd").click(function(){
                var animationName = $(this).html();
                $("#test").removeClass().addClass(animationName + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
                    $(this).removeClass();
                })
            })
        })
    </script>

</body>

</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值