在页面引入 Animate.css 库
Animate.css地址 Animate.css | A cross-browser library of CSS animations.
wow.js 下载地址 链接: https://pan.baidu.com/s/1Az1PMG8nSqrhqlRZI8Zz8Q?pwd=4nm2 提取码: 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>
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/144800.html