javascript add scroll listener

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.
});
Source

Also in JavaScript: