< ;title>
jQuery namespace div>
The effect is as shown in the picture. When I double-click, two click events will be triggered first. What's going on? Also, if I don’t want to trigger the
click event when double-clicking, but only trigger the double-click event, how should I solve it? I also tried to unbind the click event when double-clicking.
But in this way, the click event cannot be used again. . .
Later I asked others on the forum and finally got the answer. That is to use the setTimeout() method to set the time interval of the click event. This time interval is generally
set to 300ms. In this way, when double-clicking, since the time interval of double-clicking is less than 300ms, the click event will not be generated. Just generate the
dblclick event. In the double-click event, you need to use the clearTimeout() function to clear the processing of the click event. The code is as follows:
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31