Skip to content
Advertisement

Custom div as cursor creates problems with the hover on links

I’ve a problem with a custom cursor created with an absolute div, with my test I realized that the custom div is directly positioned under the default cursor, then if I go hover a link I can’t process my JS “mouseenter” because the default cursor is always hover only to the custom cursor… there is a way to fix it?

JavaScript

Scss:

JavaScript

Vanilla JS:

JavaScript

Advertisement

Answer

You can use pointer-events: none; for the cursor-div – so that the hover event goes through. (you also forgot an e in “mouseenter

Working example:

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement