What I want to do, is to catch the event when the user is scrolling div horizontally. For vertical scroll I am using event \'mousewheel\' and it\'s working properly. ( horiz
e.currentTarget.scrollX instead of e.currentTarget.scrollLeft and e.currentTarget.scrollY instead of e.currentTarget.scrollTop
I don't have the proper setup to test this, but $.scroll() should do the trick. It's probably preferable to binding the mousewheel
event as well. People use all means of scrolling ;)
You can handle horizontal scrolling by :
$("#someContainer").on("scroll", function (e) {
horizontal = e.currentTarget.scrollLeft;
vertical = e.currentTarget.scrollTop;
});
In this case this bind all kind of scroll events on this element so you can also handle
Vertical by e.currentTarget.scrollTop
and
Horizontal by e.currentTarget.scrollLeft