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

Add no-cursor via JS #18

Closed paulzz3000 closed 3 years ago

paulzz3000 commented 3 years ago

Me again (love the effect—you should sell it)... Trying to add no-cursor like this: jQuery(document).ready(function($) { $('.whatever').addClass( 'no-cursor' ); }); No joy. The class is added but ignored.

dshongphuc commented 3 years ago

@paulzz3000 well, the problem is Magicmouse auto-detect .no-cursor divs right after the page loaded. This means that when you add .no-cursor class AFTER the moment Magicmouse has been initialized, your new classes will be ignored. So my suggestion is that you should only init Magicmouse AFTER you add all those classes dynamically.

Me again (love the effect—you should sell it)...

Btw, thank you so much for your sweet words :D And no I won't sell anything. In fact, I'm planning to add more effects to this libs but am too busy currently so I will do that when I have time.

paulzz3000 commented 3 years ago

Thank you! I have no idea how to do that but I’ll work it out!

Best

Paul

On 28 Aug 2021, at 14:01, Phuc H. @.***> wrote:

@paulzz3000 https://github.com/paulzz3000 well, the problem is Magicmouse auto-detect .no-cursor divs right after the page loaded. This means that when you add .no-cursor class AFTER the moment Magicmouse has been initialized, your new classes will be ignored. So my suggestion is that you should only init Magicmouse AFTER you add all those classes dynamically.

Me again (love the effect—you should sell it)... Btw, thank you so much for your sweet words :D And no I won't sell anything. In fact, I'm planning to add more effects to this libs but am too busy currently so I will do that when I have time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dshongphuc/magic-mouse-js/issues/18#issuecomment-907623437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP56UWL7FICYS3A7QXMRQ3T7DM2ZANCNFSM5C7BN4AQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

paulzz3000 commented 3 years ago

Did it! Thank you again.

On 28 Aug 2021, at 14:17, Paul Batey @.***> wrote:

Thank you! I have no idea how to do that but I’ll work it out!

Best

Paul

On 28 Aug 2021, at 14:01, Phuc H. @. @.>> wrote:

@paulzz3000 https://github.com/paulzz3000 well, the problem is Magicmouse auto-detect .no-cursor divs right after the page loaded. This means that when you add .no-cursor class AFTER the moment Magicmouse has been initialized, your new classes will be ignored. So my suggestion is that you should only init Magicmouse AFTER you add all those classes dynamically.

Me again (love the effect—you should sell it)... Btw, thank you so much for your sweet words :D And no I won't sell anything. In fact, I'm planning to add more effects to this libs but am too busy currently so I will do that when I have time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dshongphuc/magic-mouse-js/issues/18#issuecomment-907623437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP56UWL7FICYS3A7QXMRQ3T7DM2ZANCNFSM5C7BN4AQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.