I need to detect the user "finger-press", there's already the "tap" event, but tap = press + release
.
I need to call a JS function exactly on finger-press, exactly as keypress()
does for standard browsers.
There are a couple of events for that already.
They are vmousedown
and taphold
.
You can find a complete reference about them at this link:
http://jquerymobile.com/demos/1.0/docs/api/events.html
Basically, the jQuery Mobile framework maps the major "traditional" browser UI events prefixing them with a "v".
This is to signal that they are "virtual" events, in that by this mean you can catch events coming from standard (i.e. non-touch) and even touch-oriented devices as well.
So you could install a handler for a vmousedown event with:
$('#your-element-id').live('vmousedown', function() { alert("Hello") });
taphold
, instead, is quite different: the event is triggered when a complete tap event takes place with a duration of nearly a second or more.
You can quickly play around with these two events to understand which one better fits your needs.
Do you mean like taphold
or vmousedown
?
http://jquerymobile.com/demos/1.0/docs/api/events.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With