I just answered this question about scrolling a div horizontally, I also included some code to use the mousewheel or just grab and drag with the mouse... maybe some of that code will give you an idea?
To elaborate a bit, the mousewheel function gives you the event object and the delta.
$('#container').bind('mousewheel', function(event,delta){
if (delta > 0) {
// mousewheel is going up;
} else {
// mousewheel is going down
}
});
The value of delta
depends on how fast you scroll the wheel. I've seen a range from +50 to -50 if you try really hard :P
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…