when do we use scroll listener in javascript code example
Example: when do we use scroll listener in javascript
var myElement=document.getElementById("someElementID");
myElement.addEventListener("scroll", function(ev){
ev.target.scrollTop;//pixels scrolled from element top
ev.target.scrollHeight;//pixels of the whole element.
})