Jump to content
Search Community

Av9ry

Members
  • Posts

    3
  • Joined

  • Last visited

Av9ry's Achievements

  1. Thank you @Rodrigo and @akapowl Happy New Year ?
  2. Thank you for advice. The question remains the same, what exactly ScrollTrigger.refresh() does behind the scenes, and is it ok to call it on each frame?
  3. Hi. I have my own solution for smooth scrolling. It changes the translateY of the container element on scroll using request animation frame. I was looking for a way to make ScrollTrigger work, and what I did is put this line into my update() function that's being called each frame: ScrollTrigger.refresh(); It works fine, and triggers all ScrollTrigger instances across my entire application correctly. No issues. The question is, what exactly the refresh method does, and is it okay to use it performance wise? I imagine if it calls getBoundingClientRect() it should be pretty bad to use it on each frame. The documentation says that it calculates startandendvalues, but what exactly are these values, and where do they come from — I have no idea. Would appreciate any help Thanks,
×
×
  • Create New...