views:

31

answers:

2

Hi,

I am developing an app for a touchscreen and I would like to capture the equivalent of the mouse down and mouse up events.

For example, when the user has their finger touching the screen, a javascript function will execute, but when the finger leaves the screen function stops.

I am using firefox 3.5, with the jQuery framework for my javascript.

Thanks for any help, Ben

+1  A: 

Just use jQuery mousedown and mouseup.

There are no specific events for using a finger, because all the finger actions do are to fire the mouse events on the page:

$(document).mousedown(function(e) {
   alert("Finger is Down");
});

$(document).mouseup(function(e) {
   alert("Finger is Up");
});
GenericTypeTea
This is what I originally tried before posting the question. The mouseup event doesnt get fired when the finger leaves the screen
Globalz
Perhaps you should updated your question with some code and show it now working.
GenericTypeTea
A: 

I think this jQuery plugin can help you.

Chouchenos