How do I detect horizontal scrolling with jQuery?
This will get all scrolls:
$(window).scroll(function () { alert(\'in\'); });
This seems to work.
var lastScrollLeft = 0; $(window).scroll(function() { var documentScrollLeft = $(document).scrollLeft(); if (lastScrollLeft != documentScrollLeft) { console.log('scroll x'); lastScrollLeft = documentScrollLeft; } });
jsFiddle.