Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我单击(不释放按钮)时,我可以使用mousedown():
mousedown()
$('.myClass').mousedown(function (e) { });
但是当我释放按钮时我可以使用什么?mouserelease()不存在:)
mouserelease()
有mouseup事件:
mouseup
$(".myClass").mouseup(function(e) { // ... });
我喜欢这个:
$(".myClass").on('mousedown mouseup',function( e ){ if(e.type == 'mousedown'){ // Do my stuff on mousedown }else{ // Do my stuff on mouseup } });