Septrios Posted March 17, 2022 Share Posted March 17, 2022 Hello Community, i need to you I have an gsap effect on the hover link. When my mouse is mouseover element. The element follow my mouse with an effect rotate on this element. But when i clicked on the nuxt-link ( about page ) and i come back on the Homepage, the rotate effect doesn't work anymore 😕 https://codesandbox.io/s/wonderful-glitter-llzolv Could you help me please ? :) Thx See the Pen by s (@s) on CodePen Link to comment Share on other sites More sharing options...
OSUblake Posted March 17, 2022 Share Posted March 17, 2022 Hi Septrious, Sorry, but that is way too much code to go through and debug, and it looks like most of it taken from something on Codrops, so it's probably not the best thing to just drop into a Vue/Nuxt project without doing a full conversion of the code to Vue. And just like I brought up in your last thread, you need to kill off anything that is running in beforeDestroy. Right now that code has a bunch of listeners and loops running that will keep running on top of each other resulting in memory leaks. Link to comment Share on other sites More sharing options...
Septrios Posted March 17, 2022 Author Share Posted March 17, 2022 thank you very much @OSUblake But how i can kill and stop listeners, i'm a newbie 😕 If you have any codes snippet, it will be amazing thx for your help Link to comment Share on other sites More sharing options...
OSUblake Posted March 17, 2022 Share Posted March 17, 2022 That's why I was say that you need to convert that code to Vue as it will automatically remove event listeners when you put the on your elements. But converting that code to Vue for you is not what these forums are for, please see the forum guidelines. <div :mousemove="someMethod"></div> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now