Okano Posted February 10 Share Posted February 10 const boundElements = [ '.news-list>a', '.sc-3>.box-area>.box', '.sc-4>img', '.sc-4>.img-area>picture>img' ] boundElements.forEach(element => { gsap.utils.toArray(element).forEach((el) => { gsap.to(el, { scale : 1, autoAlpha: 1, duration: 0.2, ease: "back.out(2)", scrollTrigger: { trigger: el, start: 'top bottom', toggleActions:'play none none reverse', markers: true } }); }); }); We are currently having trouble with scrollTrigger not responding on one site. The code is simple and works fine on desktop and emulator, but not on the actual device. The markers are displayed, so it appears that gsap is not locating the display area or content, rather than a loading issue. I have a feeling that there may be a style specification that is causing this problem, as another site that does the same thing displays the code correctly. Are there any such conditions? Link to comment Share on other sites More sharing options...
GSAP Helper Posted February 10 Share Posted February 10 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...
Solution Okano Posted February 10 Author Solution Share Posted February 10 I'm sorry. This issue has been resolved. I had coded the following in css. html, body{ width: 100%; height: 100%; overflow-x: hidden; position: relative; } Removing the "overflow-x: hidden;" in the html in this one works correctly. html{ width: 100%; height: 100%; body{ width: 100%; height: 100%; overflow-x: hidden; position: relative; } } Is this behavior a specification? Link to comment Share on other sites More sharing options...
GSAP Helper Posted February 10 Share Posted February 10 Not quite sure what you mean by "a specification" and it's very difficult for us to diagnose without a minimal demo. Glad you resolved the issue, though! And no, ScrollTrigger does not require that you have overflow-x on the <html>. If you still need some help, please make sure you include a minimal demo, like a CodePen. Cheers! 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