Для завершения ответа Ника Крейвера:
var wheeldelta = {
x: 0,
y: 0
};
var wheeling;
$('#foo').on('mousewheel', function (e) {
if (!wheeling) {
console.log('start wheeling!');
}
clearTimeout(wheeling);
wheeling = setTimeout(function() {
console.log('stop wheeling!');
wheeling = undefined;
// reset wheeldelta
wheeldelta.x = 0;
wheeldelta.y = 0;
}, 250);
wheeldelta.x += e.deltaFactor * e.deltaX;
wheeldelta.y += e.deltaFactor * e.deltaY;
console.log(wheeldelta);
});
прокрутка выводов:
start wheeling!
Object {x: -1, y: 0}
Object {x: -36, y: 12}
Object {x: -45, y: 12}
Object {x: -63, y: 12}
Object {x: -72, y: 12}
Object {x: -80, y: 12}
Object {x: -89, y: 12}
Object {x: -97, y: 12}
Object {x: -104, y: 12}
Object {x: -111, y: 12}
Object {x: -117, y: 12}
Object {x: -122, y: 12}
Object {x: -127, y: 12}
Object {x: -131, y: 12}
Object {x: -135, y: 12}
Object {x: -139, y: 12}
Object {x: -145, y: 12}
Object {x: -148, y: 12}
Object {x: -152, y: 12}
Object {x: -154, y: 12}
Object {x: -156, y: 12}
Object {x: -157, y: 12}
Object {x: -158, y: 12}
Object {x: -159, y: 12}
Object {x: -161, y: 12}
Object {x: -162, y: 12}
Object {x: -164, y: 12}
Object {x: -166, y: 12}
Object {x: -167, y: 12}
Object {x: -169, y: 12}
stop wheeling!