Skip to content

Commit

Permalink
Create imagehover.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumpish3007 authored Jul 12, 2024
1 parent 469bc26 commit 4a5bd50
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions imagehover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// imagehover.js

document.addEventListener('DOMContentLoaded', (event) => {
const customCursorElements = document.querySelectorAll('.custom-cursor');

customCursorElements.forEach(element => {
element.addEventListener('mouseover', () => {
document.body.style.cursor = 'url("custom-cursor.png") 125 125, auto';
});

element.addEventListener('mouseout', () => {
document.body.style.cursor = 'auto';
});
});
});

0 comments on commit 4a5bd50

Please sign in to comment.