Jump to content
Search Community

darky98

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by darky98

  1. On 2/23/2022 at 2:31 PM, OSUblake said:

    Hi darky,

     

    Here's a simpler version of that demo.

     

     

     

     

    I'm guessing to make it work you will need to make the gotoSection function available to outside the effect, like with a ref.

    gotoSection.current = gotoSection;

     

    And then listen for changes in an effect.

    useEffect(() => {
      gotoSection.current(...)
    }, [someProp])

     

    Thank you so much, you saved my life haha, hope you have a good day :)

    • Like 1
  2. Hi, i tried to make this cool effect with React  and this is what i did: https://codesandbox.io/s/lingering-rain-03x71q?file=/src/components/Navbar.js The thing is that i want to jump into a section when i click any navbar link but as far as i know i cant use any states and when i use refs i get undefined.

    I tried to copy and paste slideIn function into any onClick navlinks but it didint work, it breaks the whole app.

    How can i achive this? Hope it was understood. Thanks

    See the Pen PoWapLP by BrianCross (@BrianCross) on CodePen

  3. On 2/14/2022 at 3:03 AM, GreenSock said:

    Welcome to the forums, @darky98

     

    Please read the forum guidelines - we can't dissect a live site and provide "how to" instructions for recreating cool effects, but we'd be happy to answer any GSAP-specific questions. 

     

    That site looks like it's not even using any real scrolling - it's just listening for wheel/touch/pointer events to trigger animations. Perhaps this CodePen would prove useful: 

     

     

     

    Good luck!

    Wow! thank you very much! i made some changes for my React project and it worked, the only problem is that there is some sort of bug there with the z-index when you scroll up, but i'm figuring it out how to solve it. Thanks !

×
×
  • Create New...