Pierre space Posted January 26 Share Posted January 26 Hello ! I'm new here and I have a problem to start animation on hover. I try to make the same animation like this : https://custom-hover-animations.webflow.io/ (Character Tween V1) Can you help me ? pls This is my animation without the hover trigger : <script> gsap.registerPlugin(SplitText) var split = new SplitText("#title-b", {type: "chars"}); var splitb = new SplitText("#title-bb", {type: "chars"}); gsap.fromTo(split.chars, { y: 0, }, { duration: 1, y: -38, stagger: 0.05 } ); gsap.fromTo(splitb.chars, { y: 38, }, { duration: 1, y: -38, stagger: 0.05 } ); </script> Link to comment Share on other sites More sharing options...
GSAP Helper Posted January 26 Share Posted January 26 Without a minimal demo, it's very difficult to troubleshoot; the issue could be caused by CSS, markup, a third party library, a 3rd party script, etc. Would you please provide a very simple CodePen or Stackblitz that illustrates the issue? Please don't include your whole project. Just some colored <div> elements and the GSAP code is best. See if you can recreate the issue with as few dependancies as possible. Start minimal and then incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, at least we have a reduced test case which greatly increases your chances of getting a relevant answer. See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo: Using a framework/library like React, Vue, Next, etc.? CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: React (please read this article!) Next Svelte Sveltekit Vue Nuxt Please share the StackBlitz link directly to the file in question (where you've put the GSAP code) so we don't need to hunt through all the files. Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. ✅ Link to comment Share on other sites More sharing options...
Rodrigo Posted January 26 Share Posted January 26 Hi, Check this thread (in particular the answer by @PointC: @Carl goes into great detail about it in this video: Also this other video by Carl should be helpful as well: Hopefully this helps. Happy Tweening! 3 Link to comment Share on other sites More sharing options...
Pierre space Posted January 29 Author Share Posted January 29 Thank you for your returns. This is my demo : See the Pen GReyajj by PierreDej (@PierreDej) on CodePen I just want my gsap animation to be triggered when I hover over the button. Can you help me ? Thx Link to comment Share on other sites More sharing options...
mvaneijgen Posted January 30 Share Posted January 30 Hi @Pierre space What did you try your self already? We love to see what you can come up with, that way we can see your thought process and thus better help you understand the tools! That said here is an example. I still strongly encourage you to try finding a solution your self, that is the best way to learn! But you can take a sneak peak below. I’ve placed some comments in your JS to better explain things, please be sure to read through them! Hoop dat het helpt en veel geluk! See the Pen jOJZEQm?editors=0011 by mvaneijgen (@mvaneijgen) on CodePen 2 Link to comment Share on other sites More sharing options...
Rodrigo Posted January 30 Share Posted January 30 Hi, Here is another approach: See the Pen JjzpKey by GreenSock (@GreenSock) on CodePen Happy Tweening! 1 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