Animate 动画样式

animate css动画样式

项目测试

复制下面代码,你就可以尝试使用animate 实现动画效果啦
<!DOCTYPE>
<html>
    <head>
        <title>animate测试</title>
    <link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" />
   
    </head>
    <body>
  
       

        <div class="animated bounce">弹跳效果</div>

     

    </body>  
    



效果图
在这里插入图片描述


<!DOCTYPE>
<html>
    <head>
        <title>animate测试</title>
    <link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" />
    <style>
        #box{
            width:100px;
            height:100px;
            background:#ff0000;
        }
        </style>
    </head>
    <body>
    <div class="animated" id="box">animate</div>
        <button id="add">add</button>
        <button id="remove">remove</button>
        <script>
            var add = document.getElementById('add');
            var remove = document.getElementById('remove');
            var box = document.getElementById('box');
            add.onclick = function(){
            box.classList.add("bounceInLeft");
            box.classList.remove("bounceOutLeft");
            }
            remove.onclick = function(){
            box.classList.add("bounceOutLeft");
            box.classList.remove("bounceInLeft");
            }
        </script>
    </body>  


<!DOCTYPE>
<html>
    <head>
        <title>animate测试</title>
    <link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" />
   
    </head>
    <body>
    
        <h1 class="animated hinge">PHP中文网</h1>
        
    </body>  

效果图:

在这里插入图片描述
3.


<!DOCTYPE>
<html>
    <head>
        <title>animate测试</title>
    <link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" />
   
    </head>
    <body>
    
        <button class="btn">点击</button>

        <h1>PHP中文网</h1>

        <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

        <script type="">

            $(function(){

                $(".btn").click(function(){

                    $("h1").addClass('animated shake');

                 

                });

            })

        </script>

    </body>  

效果图
在这里插入图片描述4,同样我们还可以使用动画延迟和动画迭代计数更改动画中的延迟和播放的次数


<!DOCTYPE>
<html>
    <head>
        <title>animate测试</title>
    <link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" />
   
    </head>
    <body>
        <style>
            .animated{

-webkit-animation-iteration-count:5;

-webkit-animation-duration:1s;

animation-iteration-count:5;

animation-duration:1s;

}
        </style>
    
        <button class="btn">点击</button>

        <h1>PHP中文网</h1>

        <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

        <script type="">

            $(function(){

                $(".btn").click(function(){

                    $("h1").addClass('animated shake');

                 

                });

            })

        </script>

    </body>  

参考链接
参考链接
参考链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值