1
在阅读THIS教程并使用他们的代码后,我试图使用scrollReveal.js,但是当我的视口位于它们上面时,我仍然无法让我的div淡入。滚动显示不能正常工作
的Html
<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没有定义”
,能得到任何其他错误,如一个404错误?你的代码在哪里? *在您加载'scrollreveal.min.js'之后它来了吗?此外,该网站似乎有一个错字。它应该是'新的ScrollReveal()' –
我只收到一个错误(“参考错误”)。而我的代码是在我的身体标记的末尾,我在我的头部开始加载scrollReveal。 –
@RhysEdwards尝试在页面末尾的脚本之前加载库 – Alexis