Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 1.13 KB

07-animate-From-a-variable-point-with-from-and-fromto-in-greensock.md

File metadata and controls

26 lines (22 loc) · 1.13 KB

Animate From a Variable Point with from and fromTo in GreenSock

📹 Video

Use TweenMax.from

  • 🤔TweenMax.from docs
  • Very similar to the TweenMax.to() used before, except the properties will be where the animation starts, and its current position will be where it ends.
document.addEventListener('click', event => {
    const { x, y } = event
    TweenMax.fromTo('#box', 1, { x, y })
})

Use TweenMax.fromTo

  • 🤔TweenMax.fromTo docs
  • Same as the .from() except a fourth argument sets where the animation will end.
document.addEventListener('click', event => {
    const { x, y } = event
    TweenMax.fromTo('#box', 1, { x, y }, { x: 200, y: 200 })
})

📹 Go to Previous Lesson 📹 Go to Next Lesson