Hi everybody!
I'm making a Firefox OS app, and I would like to handle a long press to
show a confirm dialog.
I'm trying to do it by jquery event handlers, but it doesn't work.
Does exist any Firefox OS function to do it? I need some help, please.
Thanks in advance
Regards, Mar.
PD: My code is as follows:
var longpress = false;
$(div).on('click', function () {
if(longpress){
console.log("Long press "+$(this).attr('idMessage'));
}else{
console.log("Short click "+$(this).attr('idMessage'));
}
});
var startTime=0, endTime;
$(div).on('mousedown', function () {
startTime = new Date().getTime();
});
$(div).on('mouseup', function () {
endTime = new Date().getTime();
longpress = (endTime - startTime < 500) ? false : true;
});
_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps