Jump to content
Search Community

mjray

Members
  • Posts

    10
  • Joined

  • Last visited

Community Answers

  1. mjray's post in Is it possible to scroll to a timeline label with GSAP Timeline and ScrollTrigger? was marked as the answer   
    Alright was able to figure it out! The big issue for me was that I was using different durations in the gsap.to function which was causing all sorts of weird issues - I assumed the duration was the duration of scrolling time but it looks like it changes the scroll position value so it must work differently - not sure why but setting it to 1 does the trick.
     
    $('.nav-link').click(function() {
        var st = timeline.scrollTrigger;
        var pos = st.start + (st.end - st.start) * (timeline.labels['section'] / timeline.duration());
        gsap.to(window, {scrollTo: pos, duration: 1});
    });
×
×
  • Create New...