Long Press in JavaScript?

Posted by Randy Mayer on Stack Overflow See other posts from Stack Overflow or by Randy Mayer
Published on 2010-04-12T20:29:23Z Indexed on 2010/04/12 20:33 UTC
Read the original article Hit count: 538

Hi,

Is it possible to implement "long press" in JavaScript (or jQuery)? How?

alt text

HTML

<a href="" title="">Long press</a>

JavaScript

$("a").mouseup(function(){
  // Clear timeout
  return false;
}).mousedown(function(){
  // Set timeout
  return false; 
});

Thank you!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about javascript-events