+ 1
Cursor tracking problem
How can i get the coordinates of the cursor relative to a divider? I've tried using clientX and clientY but i dont understand how to access them.
2 Antworten
+ 2
https://code.sololearn.com/W7h17CZuUANB/?ref=app
I have used clientX and clientY in a project of mine. Maybe this will help.
So basically, you make a function with a parameter(evt for example).
inside the function you make a variable, let s say:
let abc= evt.clientX;
You add that function in a event for any html element(body, for example)(can be seen in the code)
whenever the event listener is triggered, your variable will tell you what is the cursor position.
For this code I used click event, but it works with any event.
0
Now i understand what was the problem, thank you. Nice app by the way.