Jump to content
Search Community

nguyenhoangvubt

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by nguyenhoangvubt

  1. 8 hours ago, GreenSock said:

    You weren't defining the "scroller" properly. And you could simplify a lot by just using the useGSAP() hook. Plus I think you had the wrong API for LocomotiveScroll: 

    https://stackblitz.com/edit/react-6bgnhq?file=src%2FApp.js

     

    Please keep in mind that LocomotiveScroll is not a GreenSock product, so we can't really support it here. 

     

    I hope this gets you going in the right direction. 

    Hi, thank you for spending time with me, I checked the fix that you make for me and it work perfectly. Once again, thank for your support.

    • Like 2
  2. 4 hours ago, GSAP Helper said:

    Hi @nguyenhoangvubt,

     

    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 Stackblitz that demonstrates 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. 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

     

     

    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: 

     

    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. 

    Hi, so thanks for early reply.
    I forgot to share the link. here is the link: https://stackblitz.com/edit/react-2nh63l?file=src%2FApp.js
    When I use your template above, it work perfectly, the quotes were pinned as expected. But when I apply with locomotive scroll, it not working :((.

  3. On 1/6/2023 at 4:29 AM, Rodrigo said:

    Hi,

     

    You're still pinning the quotes container in your code:

    gsap.to(".quotes-wrapper", {
      xPercent: -100 * (sections.length - 1),
      ease: "none",
      scrollTrigger: {
        trigger: ref.current, // ref is the element with class quotes
        start: "top center",
        end: () => "+=" + ref.current.offsetWidth,
        scrub: 0.5,
        markers: true,
        pin: true
      }
    });
     

    Pin true by default pins the trigger element which is the quotes. The trigger element has to be the parent element. Also there could be some other issues that are brought to the table by locomotive. Unfortunately we don't have the time resources to debug third party plugins/components. I created a simple example without locomotive and it seems to work fine:

     

    https://stackblitz.com/edit/react-w4eihw?file=src%2Fstyle.css,src%2FApp.js

     

    Hopefully this helps. Let us know if you have more questions.

     

    Happy Tweening!

    I  forked from the example that you gave, then bring my work into, please help me check the problem, the pinned element also disapeared.

×
×
  • Create New...