dshongphuc / magic-mouse-js

A lightweight javascript library to create some amazing effects for the mouse (cursor) on your website - MagicMouse.js : https://magicmousejs.web.app/
MIT License
389 stars 60 forks source link

Disable on element #15

Closed paulzz3000 closed 3 years ago

paulzz3000 commented 3 years ago

Hi Brilliant work. Is there a way to hide it when over a particular item—like cursor: none; Thank P

dshongphuc commented 3 years ago

Hi @paulzz3000 , have you tried to set cursor:none; on the element you want to hide cursor? I think you just need to create a css class and set that class to all the items you wanna hide. It should work :)

paulzz3000 commented 3 years ago

Thanks, I did try that. It only hides the sytem cursor. I'd like to be able to hide the magicmousecursor too.

paulzz3000 commented 3 years ago

If that's not possible, Instead of completely disabling, is it possible to have the hoverItemMove true on some but false on others?

dshongphuc commented 3 years ago

Hi @paulzz3000 , thank you for your suggestion. I understand your idea now, so I've just updated a way to disable the cursor on some elements. Please go to the readme and check the instruction (remember to get new code, it's also on CDN now) Screenshot from 2021-08-25 10-42-41

paulzz3000 commented 3 years ago

Perfecto! Thank you. Is there any way to do the hoverItemMove thing to0? Some elements, especially those with animation via GSAP, for example, compete with the movement. Is there a way to apply hoverItemMove=none via attribute on specific elements?