Jump to content
GreenSock

avizmarques

Members
  • Posts

    11
  • Joined

  • Last visited

avizmarques's Achievements

  1. Thanks a lot!! I managed to make it work by using gsap.context() inside a useLayoutEffect (it was not working with a normal useEffect), and by importing ScrollTrigger in the _app file. The example was very useful.
  2. I am trying to use ScrollSmoother in my nextjs project, however I am being unable to import the module. I get the error "module not found". I am using the dist folder for the import, and v 3.11.1 import { ScrollSmoother } from 'gsap/dist/ScrollSmoother';
  3. Hi, I am trying to install the beta due to this same problem, but I can't find the package in yarn. How can I use it? Thank you in advance
  4. Hi Rodrigo, thank you for your reply. In the example you sent me, ScrollTrigger is not really being used as a plugin, is it? Or is this how it should be used? When you try to use a gsap.to or a gsap.from it does not work anymore. For example: gsap.from(numbers, { textContent: 0, duration: 2, snap: { textContent: 1 }, scrollTrigger: { trigger: section, start: 'top bottom' }, });
  5. I've been animating a counter in this way, but it no longer works after upgrading to gsap 3.11. I don't see anything in the release notes that could cause it, so not sure if it's a bug? What happens now is that the text is simply replaced by a 0, but it does not increment as before. I tried removing the scrolltrigger, but that does not seem to be the issue - it does not animate regardless. const numbers = document.querySelectorAll('#number-counter'); gsap.from(numbers, { textContent: 0, duration: 2, snap: { textContent: 1 }, scrollTrigger: { trigger: section, start: 'top bottom', markers: true }, });
  6. thanks for your reply, these links are useful. However, I don't seem to be able to use gsap.context. I get an error: Property 'context' does not exist on type 'typeof gsap'.ts(2339) View Problem forcing the type does not work, it says gsap.context() is not a function. (edit: my bad I was using 3.10, upgrade fixed this ^ ) The problem I am getting is that somehow it looks like ScrollTrigger is missing when I navigate from another page that has a ScrollTrigger with react next. It tells me it's missing the plugin, even though I register it in the component.
  7. hi, I'm having the same problem. did you find out what was happening? it seems like scrolltrigger does not get instantiated when you navigate between pages. when you refresh, it works fine, but when you navigate to another page it breaks.
×