I've read many tutorials, but I'm struggling to get ScrollReveal to work. I have two major columns, with the left using a scroll bar, and the right with no scrolling.
There are no errors in the console, and I get this when I inspect the div element that I want revealed:
<div class="foo" data-sr-id="1" style="; visibility: visible; -webkit-transform: translateY(0) scale(1); opacity: 1;transform: translateY(0) scale(1); opacity: 1;-webkit-transition: -webkit-transform 0.5s cubic-bezier(0.6, 0.2, 0.1, 1) 0s, opacity 0.5s cubic-bezier(0.6, 0.2, 0.1, 1) 0s; transition: transform 0.5s cubic-bezier(0.6, 0.2, 0.1, 1) 0s, opacity 0.5s cubic-bezier(0.6, 0.2, 0.1, 1) 0s; ">
text1
</div>
Here is what's in the head section:
<script src="https://unpkg.com/scrollreveal/dist/scrollreveal.min.js"></script>
<script>
window.sr = ScrollReveal();
</script>
<style>
/* Ensure elements load hidden before ScrollReveal runs */
.sr .fooReveal {
visibility: hidden;
}
</style>
Right before the closing body tag, I have this:
<script>
// window.sr = ScrollReveal();
// as a DOM node...
var fooContainer = document.getElementById('fooContainer');
sr.reveal('.foo', {
container: fooContainer
});
console.log(fooContainer)
// as a selector...
sr.reveal('.bar', {
container: '#barContainer'
});
</script>
Finally, when I type ScrollReveal into the console, I get this:
ScrollReveal 15:10:28.907 ƒ e(n){return"undefined"==typeof this||Object.getPrototypeOf(this)!==e.prototype?new e(n):(O=this,O.version="3.3.6",O.tools=new E,O.isSupported()?(O.tools.extend(O.defaults,n||{}),O.defaults.container=…
Any ideas what I'm doing wrong?