mrWilson Posted June 2, 2020 Share Posted June 2, 2020 Hi, I'm using Swiper slider, and I've created fixed position captions for it. I don't want them to move with the slide as usual, so I lifted captions out of the slide. I got it to work, but I'm having trouble animating them. I don't know how to do it. For example: if the slide changes then the previous slide titles fade out + slide up, and the next slide titles fade in + slide up. Thank you. See the Pen gOPOOdp by mrWilson123 (@mrWilson123) on CodePen Link to comment Share on other sites More sharing options...
PointC Posted June 2, 2020 Share Posted June 2, 2020 I don't see GSAP used in your demo. What exactly is the GSAP related problem or question here? 2 Link to comment Share on other sites More sharing options...
mrWilson Posted June 2, 2020 Author Share Posted June 2, 2020 Hi, PointC It's because i don't know how to animate titles with gsap in this particular situation. I was hoping someone could help me with that. Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 2, 2020 Share Posted June 2, 2020 12 minutes ago, mrWilson said: It's because i don't know how to animate titles with gsap in this particular situation. I was hoping someone could help me with that. Well, you'd need to put something in the callback for the transition. I believe that's slideChangeTransitionStart in your example. Only instead of switching out the content you'd do something like (in pseudo-code): gsap.to(currTitle, {autoAlpha: 0, y: -100}); gsap.from(nextTitle, {autoAlpha: 0, y: 100}); I'm not familiar with Swiper to know what those references should be. You could just build the whole thing with GSAP: Perhaps the Getting Started article for GSAP can help: 1 Link to comment Share on other sites More sharing options...
mrWilson Posted June 5, 2020 Author Share Posted June 5, 2020 Thank you for reply, @ZachSaucier I understand how GSAP works, but unfortunately, that doesn't help me further. Building the whole thing with GSAP is not an option for me. Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 5, 2020 Share Posted June 5, 2020 4 hours ago, mrWilson said: Building the whole thing with GSAP is not an option for me. I discussed two solutions in the post above, the first being just using the callbacks that Swiper gives you to animate what you need to Link to comment Share on other sites More sharing options...
mrWilson Posted June 7, 2020 Author Share Posted June 7, 2020 Hi, @ZachSaucier This is what I have reached so far: See the Pen OJMVwzd by mrWilson123 (@mrWilson123) on CodePen 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