简体   繁体   English

单击事件并移动鼠标

[英]click event and moving the mouse

Is the click (or contextmenu , dblclick ) event fired if, between the press and release of the mouse button, the mouse is moved within the object the event is bound to? 如果在按下和释放鼠标按钮之间鼠标移动了事件绑定到的对象,是否会触发click (或contextmenudblclick )事件? Does it depend on the browser? 是否取决于浏览器?

At least for clicking on a link, the click event seems to be canceled if I move the mouse. 至少对于单击链接而言,如果我移动鼠标,单击事件似乎被取消。 But for other types of clicks, it looks like they are fired sometimes. 但是对于其他类型的点击,似乎有时会被触发。 I am not sure if my observation is right. 我不确定我的观察是否正确。

Then event is triggered after the release when the mouse is pressed and released on the bound object 然后,在释放并按下鼠标并在绑定的对象上释放时触发事件

The click event is sent to an element when the mouse pointer is over the element, 
and the mouse button is pressed and released. 

I know this is jQuery, but it explains it well: http://api.jquery.com/click/ 我知道这是jQuery,但说明得很好: http : //api.jquery.com/click/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM