我正在开发一个phonegap 项目。我需要实现一个长新闻事件。我们如何使用 JavaScript 检测图像/按钮的长按?
最佳答案
$('#target').mousedown(function() {
alert('Handler for .mousedown() called.');
//start a timer
});
$('#target').mouseup(function() {
alert('Handler for .mouseup() called.');
//stop the timer and decide on long click
});
关于javascript - 如何检测长按按钮/图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11392138/