📹 Video
- Start with a TweenMax.to().
TweenMax.to('element', 1, { scale: 1.25 })
- Add the repeat property.
- a positive number will repeat that many times
- a negative one will cause it to repeat continuously, but will jump back to the start
- Use
yoyo: true;
to have the animation go back and forth (instead of restarting).
TweenMax.to('element', 1, {
scale: 1.25,
repeat: -1,
yoyo: true
})
- GreenSock has a neat 🤔Elastic effect
- Import Elastic along with TweenMax from gsap.
import { TweenMax, Elastic } from 'gsap'
- Set the ease property in your animation to any of the Elastic properties.
TweenMax.to('element', 1, { scale: 1.25, repeat: -1, yoyo: true, ease: Elastic.easeInOut })