Jump to content
Search Community

Florent Catiau-Tristant

Members
  • Posts

    2
  • Joined

  • Last visited

Community Answers

  1. Florent Catiau-Tristant's post in Horizontal section animated with ScrollTrigger: scrollTo not working was marked as the answer   
    Ok I figured this out myself! (So proud haha)
     
    Basically, I had to compute the scroll level of the scroller manually. It's a simple computation:
     
    const scrollOffset = (TIMELINE.scrollTrigger.end - TIMELINE.scrollTrigger.start) / NUMBER_OF_SECTIONS // start is the Y pos where the scrolltrigger starts, the offset is how much scroll pixels to reach next section * by the number of the section to reach const scrollYTarget = TIMELINE.scrollTrigger.start + scrollOffset * INDEX_OF_SECTION gsap.to(window, {duration: 2, scrollTo: scrollYTarget });
×
×
  • Create New...