Animate.css 与wow.js 实现效果 保姆级教学

92 阅读1分钟

在页面引入 Animate.css 库

Animate.css地址 Animate.css | A cross-browser library of CSS animations.

wow.js 下载地址 链接: pan.baidu.com/s/1Az1PMG8n… 提取码: 4nm2 复制这段内容后打开百度网盘手机App,操作更方便哦

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<link rel="stylesheet" type="text/css" href="css/animate.min.css" />
	</head>
	<body>
        //例子
        <div class="wow animate__backInRight" data-wow-duration='3s'></div>
        

		<script src="js/wow.min.js"></script>
        <script type="text/javascript">
            // 动画
            if (!/msie [6|7|8|9]/i.test(navigator.userAgent)) {
                var wow = new WOW({
                boxClass: "wow", //需要执行动画的元素的 class
               animateClass: "animated", //animation.css 动画的 class
                offset: 0, //距离可视区域多少开始执行动画
                mobile: true, //是否在移动设备上执行动画
                live: true, //异步加载的内容是否有效
          });
          wow.init();
        }
        </script>
	</body>
</html>