How does JS stop click events in mouseover

A BUTTON performs two actions, one is a move, the other is a click, and then the move is done with the mouseup+mousemove+mousedown event, and the click is click. But the click event is still triggered when I move it. The biggest difference between mobile and click is whether the mousemove event is executed, so I think I can stop the click event in the mousemove event. I don"t know if there is any way

Mar.30,2022

you can put a flag variable in the mousemove event to determine whether the variable is true in the click event, and if so, directly return


has been written for you, codepen example

the idea is that if the button is moving, the click event is prevent default, and if the button stops moving, it is clicked normally. Whether or not to stop moving is judged by a timer, and if the last mobile event passes through the 300ms and no longer triggers the mousemove event, it is judged to stop moving.


just answer from your title, isn't there a type in the e of the event method? According to type, then stoppropagation will be fine

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34d45-2bf29.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34d45-2bf29.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?