Jump to content
Search Community

trych

Members
  • Posts

    51
  • Joined

  • Last visited

Community Answers

  1. trych's post in Recalculate scrollTo target position during tween was marked as the answer   
    @mvaneijgen Thanks for your response and your advice (and sorry for the late response, I had a vacation get between me and the project).

    I solved the issue now by calculating the "missing" extra height of the container (the document.body in this case) and adding it to the body, so element can be scrolled to top.
     
    Here is an updated sketch:
    See the Pen ZEVYQVr by trych (@trych) on CodePen

      Upon further fiddling I figured out that I do not even need to calculate the exact size, I can just add any big enough value (so anything bigger than window.innerHeight) temporarily, then it has enough space to scroll and the scrolling can be calculated correctly by the scrollTo plugin.

    Thanks for your help everybody!
  2. trych's post in onStart does not fire on scrollTrigger animation was marked as the answer   
    Ok, seems I can answer my own question. When I use the doc's onUpdate example in this setup, I get back something like this on page load: 5.11247182388966e-7 1 true. So it seems like after page load the ScrollTrigger animation has already started ever so slightly. I fixed my issue now, by giving the ScrollTrigger a starting value of 1 pixel, then it will fire the onStart callback correctly.
×
×
  • Create New...