Capítulo 337 de 411

Chapter 337: .getTween

Core Idea

Returns the scrub tween (default) or the snapping tween (getTween(true))

Key Concepts

  • snap: Boolean

Code Examples

let st = ScrollTrigger.create({
  animation: myTween,
  scrub: 1,
  trigger: ".panel-1",
});

// then later...
st.getTween().progress(1); // force the scrub to its end to make it catch up with the current scroll position immediately
  • What it demonstrates: typical usage of .getTween in a GSAP animation.

Key Takeaways

  1. snap: Boolean