📅  最后修改于: 2022-03-11 15:02:55.351000             🧑  作者: Mango
var timeoutId = 0;
$('#myElement').on('mousedown', function() {
timeoutId = setTimeout(myFunction, 1000);
}).on('mouseup mouseleave', function() {
clearTimeout(timeoutId);
});