vlrftps Posted November 28, 2022 Share Posted November 28, 2022 I have weird delay happening when using split text Line animation. So I have 5-6 sections where I gave split text animation on headings and body text. With start of animation: start: "100px bottom", it is working fine till second or third section, but when I reach the fourth and fifth section the animation is not happening 100px from bottom... it is reaching almost the center of the viewport... Any ideas? The site is made in Webflow - here is the link. The weirdest thing is that when I moove the section to be Second, the animation works fine... Link to comment Share on other sites More sharing options...
GSAP Helper Posted November 28, 2022 Share Posted November 28, 2022 It's pretty tough to troubleshoot without a minimal demo - the issue could be caused by CSS, markup, a third party library, your browser, an external script that's totally unrelated to GSAP, etc. Would you please provide a very simple CodePen or CodeSandbox that demonstrates the issue? Please don't include your whole project. Just some colored <div> elements and the GSAP code is best (avoid frameworks if possible). See if you can recreate the issue with as few dependancies as possible. If not, incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, then at least we have a reduced test case which greatly increases your chances of getting a relevant answer. Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo: See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen If you're using something like React/Next/Nuxt/Gatsby or some other framework, you may find CodeSandbox easier to use. 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...
vlrftps Posted November 28, 2022 Author Share Posted November 28, 2022 Okay, so baisicly this is the code, but I am not able to reproduce the bug here: See the Pen vYraNaR by valeri-karageorgiev (@valeri-karageorgiev) on CodePen Link to comment Share on other sites More sharing options...
mvaneijgen Posted November 28, 2022 Share Posted November 28, 2022 Hi @vlrftps welcome to the forum! That is really weird. We ask for a minimal demo, because we can't debug a live site, there is no way to add or remove code or sometimes even view it, so that makes finding the problem really hard. If you can't reproduce the bug on Codepen I would recommend disabling CSS and JS on your site in big chunks and try to narrow it down from there, until you've found the culprit. When working with ScrollTrigger also try enabling the markers: true or even disable ScrollTrigger all together, to see if the animation you've build works as expected without the scroll logic. Hope it helps and happy tweening! 2 Link to comment Share on other sites More sharing options...
vlrftps Posted November 29, 2022 Author Share Posted November 29, 2022 Okay I managed to fix it. I found what was making the issue. The problem was related to the element that was set to Relative position and it was pushing the whole animation timeline like 500-600px for some reason, but when I changed the position from relative to absolute it all got fixed... You can see the funciton that I used below. $(".need-animated").each(function (index) { let triggerElement = $(this); let targetElement = $(this); let tl = gsap.timeline({ scrollTrigger: { trigger: triggerElement, // trigger element - viewport start: "bottom 80%", end: "top top", scrub: 1 } }); tl.from( targetElement, { fontSize: "8em", y: "-190%", duration: 1 }, { @mvaneijgen thank you for your help! 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