Tag: 点击鼠标

在mouseup事件处理程序中取消单击事件

编写一些拖放代码,我想在我的mouseup处理程序中取消单击事件。 我认为防止默认应该做的伎俩,但点击事件仍然被触发。 有没有办法做到这一点? 这不起作用: test $(“#test”).mouseup (function (e) { var a = 1; e.preventDefault(); }); $(“#test”).click (function (e) { var a = 2; });