cursor
=
{
x
:
0
,
y
:
0
}
;
document
.
addEventListener
(
'mousemove'
,
getCursorPosition
)
;
getCursorPosition
(
event) {
\t
cursor
.
x
=
event
.
pageX
;
\t
cursor
.
y
=
event
.
pageY
;
}
A bare-basic example/template demonstrating how to get the X and Y position of the cursor/mouse relative to the web page.
You can also implement
BT-JSinto your script to more easily access information about the cursor!
Element version: 1.0 (Last updated: January 21, 2024)