I have following scenario:
I have a code, binded to the mousewheel event
$('#main').bind("mousewheel",function(ev, delta) {
ev.preventDefault();
if(delta == '-1') {
alert("The user is trying to scroll upwards");
} else {
alert("The user is trying to scroll down");
}
});
I then included this Plugin which provides the use of Iphone/Ipad touch events.
Look at following code:
$('#main').bind('touchmove', function(event) {
ev.preventDefault();
});
I want to alert the direction in which the user is scrolling. How can I do this?
Thanks in advance!
Try using this awesome library.
jQuery('#swipe').bind('swipeup',eventHandler);
jQuery('#swipe').bind('swipedown',eventHandler);
More info: http://jgestures.codeplex.com/