Animate.css简单使用

引入animate.css文件

1.网络引用 

<link rel="stylesheet" href="https://raw.githubusercontent.com/daneden/animate.css/master/animate.css">

2.下载css

https://daneden.github.io/animate.css/,下载并保存为css文件

使用方法

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="stylesheet" href="css/animate.css">
    <script type="text/javascript" src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
    <style type="text/css">
            * {
            margin: 0;
            padding: 0;
        }

        .modal_content {
            width: 500px;
            height: 500px;
            margin-left: 650px;
            background-color: rgba(44, 55, 84, 0.8);
            margin-top: 150px;
            border-radius: 25px;
            /*设置动画属性*/
			/*动画持续时间*/
            -webkit-animation-duration: 3s;
           /*动画延迟时间*/
            -webkit-animation-delay: 1s;
           /*动画执行次数*/
            animation-iteration-count: 1;  
        }

        @media screen and (max-width:1000px) {
            .modal_content {
                width: 300px;
                height: 500px;
                margin-left: -150px;
            }
        }
    </style>
    <script type="text/javascript">
        $(function () {
            //给div增加类型添加动画
			var modal_animate= $('.modal_content');
            // infinite 无限重复动画  animated 规定是一个动画  tada动画名称
           modal_animate.addClass('animated tada');
		   //动画完后执行的函数
           modal_animate.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
                    console.log('hello world'); //动画完毕后才打印
		    //移除动画
                    modal_animate.removeClass('animated tada');
                    //添加动画
		    modal_animate.addClass('animated rotateIn');
                });
        });
    </script>
</head>

<body>
    <div class="modal_content">
        <h1 align="center">文字部分</h1>
    </div>
</body>

</html>
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值