webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 421 forks source link

Capture scroll event #246

Open juanghurtado opened 6 years ago

juanghurtado commented 6 years ago

Is it possible to capture the scroll event? My use-case needs it to be able to check when the bottom of the document has been reached (a classic "read terms and conditions" use-case).

I've been trying with this, but no luck so far:

            <script>
            function scroll(o) {
                   console.log(o)
            }
            </script>
            <div id = "canvasContainer" onscroll="scroll(this)">
                <div id = "canvas"></div>
            </div>

Thanks for your time!