Skip to content

Commit 87b5afc

Browse files
committed
magnetic button added
1 parent eee2c7e commit 87b5afc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

MagneticButton/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ console.log("hello");
22
let btn = document.querySelectorAll(".btn");
33
btn.forEach((el) => {
44
el.addEventListener("mousemove", (e) => {
5+
e.preventDefault();
56
let rect = el.getBoundingClientRect();
67

78
let x = e.clientX - (rect.left + rect.width / 2);

0 commit comments

Comments
 (0)