Jump to content
Search Community

alexbrt

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by alexbrt

  1. Hi all!

     

    I am currently working on a SPA in which I use a ScrollSmoother instance to synchronize the window's scroll with some WebGL elements, and I also use ScrollTrigger to pin sticky elements.

     

    A section of this website has a filtering system which dynamically adds / removes items from the DOM. After the DOM updates, I call ScrollTrigger.refresh() to recalculate the positions and then ScrollSmoother.scrollTo() to scroll back to the top of the section which is always present in the DOM. The pinned items' positions are correctly recalculated; however, the ScrollSmoother.scrollTo() call does nothing unless I delay it (via a setTimeout()).

     

    I was wondering if you guys know off the top of your heads when it is actually safe to call ScrollSmoother.scrollTo() after updating the DOM.

     

    I will try later today to reproduce the issue on a CodePen, though I couldn't help but pop the question now because it's currently really late in my time zone.

     

    Many thanks!

  2. Hello guys!

     

    While trying out a series of patterns to orchestrate independent animations with reusable tweens, I realized that only adding callbacks to a timeline will not update the timeline's duration even if using the position parameter.

     

    Although I did not end up doing the above, I thought I might as well share with you guys to see if it is in fact intended behavior.

    See the Pen VwKdeKZ by alexbrt (@alexbrt) on CodePen

×
×
  • Create New...