开发者

Is .click() an actual mouse click? [duplicate]

开发者 https://www.devze.com 2023-03-28 16:50 出处:网络
This question already has answers here: 开发者_运维百科 Closed 11 years ago. Possible Duplicate: Click source in JavaScript and jQuery, human or automated?
This question already has answers here: 开发者_运维百科 Closed 11 years ago.

Possible Duplicate:

Click source in JavaScript and jQuery, human or automated?

How can you check if a .click() is an actual mouse click or you just are calling .click()?


I don't think you can.

But you can instead use a different event, like mousedown, but that could also be called manually as well.

Why do you need to differentiate between code-triggered and user-triggered events?


Set the action for the click event to call a function with the argument isClick=1. When you call the same function otherwise, call it with isClick = 0.

0

精彩评论

暂无评论...
验证码 换一张
取 消