在阅读了scrollReveal.js教程并使用了它们的代码之后,我尝试使用这,但是当我的视图在它们上时,我仍然不能让div淡入。
<head>
<script src="scrollreveal-master/dist/scrollreveal.min.js"></script>
</head>
<div data-sr>This is the first div</div>
<div data-sr>This is the second div</div>
<div data-sr>This is yet another div</div>javascript
new scrollReveal();当我在网页上看到控制台时,上面写着
“未定义的ReferenceError: scrollReveal”
发布于 2016-11-16 16:19:25
尝试像这样使用scrollReveal在滚动体上添加一个动画
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="main">
<div data-sr> one </div>
<div data-sr> two </div>
<div data-sr> three </div>
</div>
<script src="https://unpkg.com/scrollreveal@3.3.2/dist/scrollreveal.min.js"></script>
<script>
// Changing the defaults
window.sr = ScrollReveal({ reset: true });
// Customizing a reveal set
sr.reveal('div', {opacity: 0.9,duration:3000});
</script>
</body>
</html>https://stackoverflow.com/questions/40635747
复制相似问题