D
D
Dima2020-06-16 14:22:52
JavaScript
Dima, 2020-06-16 14:22:52

What event is responsible for pointing to the block but with the LMB pressed in advance?

in vue it works with the slightest movement of the mouse without holding the left click, but in js everything works as it should https://codepen.io/DimaDolgoter/pen/WNrxaKG?editor... although the event is the same Since in vue to track the mouseover event with holding the LMB button? @mousemove="md.status = !md.status"


Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pashenka, 2020-06-16
@like-a-boss

There are no such events.
1. An event listener is hung on the document mousedown, set the flag = true in it .
2. A listener is hung on the document (or on a common element that wraps all the elements of interest) mousemove, it checks whether the flag from clause 1 is set in it. If the flag === true , we do what interests us.
3. An event listener is hung on the document mouseup, the flag is set to false in it .

A
Aetae, 2020-06-16
@Aetae

Codepen does n't work properly . The first one always works there if, and in the same way for every movement.
You should use not .which, but .buttons.
You should use not mousemove, but mouseenter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question