From 2abfe39fe432581833a84da5dacbd4f32b900d09 Mon Sep 17 00:00:00 2001 From: Aditya Kumar <121501207+Aditya0950@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:07:02 +0530 Subject: [PATCH] Update script.js --- script.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script.js b/script.js index 326f26a..649d4b9 100644 --- a/script.js +++ b/script.js @@ -32,3 +32,11 @@ nav.addEventListener("mouseleave", function () { a.style.top = "0%"; }) }) + +let crsr = document.querySelector("#Cursor"); +let container = document.querySelector("#Container"); + +container.addEventListener("mousemove", function (dets) { + crsr.style.top = dets.y + "px"; + crsr.style.left = dets.x + "px"; +})