Can I get mouse position on scrolling event?
If I have a code:
angular.element($window).bind("scroll", function() {
console.log("scroll");
// mouse position (x,y) ?
});
Can I get mouse position on scrolling event?
If I have a code:
angular.element($window).bind("scroll", function() {
console.log("scroll");
// mouse position (x,y) ?
});
angular.element($window).bind("scroll", function(event) {
console.log("scroll");
console.log(event.clientX, event.clientY); //relative to window
console.log(event.pageX, event.pageY); //relative to window
});
You can use
angular.element($window).bind("scroll", function(event) {
console.log("scroll");
var domElem = event.target;
var nbPXFromTop = domElem.scrollTop; //nb of pixel from the top
var nbPxFromLeft = domElem.scrollLeft;
});