Skip to content

Commit

Permalink
basic changes in cursour tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajaravi99 committed Oct 13, 2024
1 parent 8ebf755 commit 684c1ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ tag.addEventListener("click", (event) => {
document.addEventListener("mousemove", (e) => {
let x = e.pageX;
let y = e.pageY;
myDiv.style.left = x - 20 + "px";
myDiv.style.top = y - 20 + "px";
myDiv.style.left = x + "px";
myDiv.style.top = y + "px";
});
//For touch
document.addEventListener("touchmove", (e) => {
let x = e.pageX;
let y = e.pageY;
myDiv.style.left = x - 20 + "px";
myDiv.style.top = y - 20 + "px";
myDiv.style.left = x + "px";
myDiv.style.top = y + "px";
});


Expand Down

0 comments on commit 684c1ce

Please sign in to comment.