Details
gsap.globalTimeline
is the timeline that all other GSAP tweens and timelines make use of under the hood. Thus manipulating gsap.globalTimeline
can be very powerful if you're wanting to affect all other tweens and timelines at once.
Methods
gsap.globalTimeline.pause()
- Pauses the global timeline which affects ALL animations. Returns itself.gsap.globalTimeline.play()
- Resumes the global timeline which affects ALL animations. Returns itself.gsap.globalTimeline.paused()
- Returnsfalse
if the global timeline is paused. Returnstrue
if the global timeline is playing.gsap.globalTimeline.isActive()
- Returnsfalse
if the global timeline is not active. Returnstrue
if the global timeline is active.-
gsap.globalTimeline.timeScale()
- Gets or sets the globaltimeScale
which is a multiplier that affects ALL animations equally. This doesn’t actually set thetimeScale()
of each individual tween/timeline, but rather it affects the rate at which the root timeline plays (that timeline contains all other animations). This is a great way to globally speed up or slow down all animations at once. For example:gsap.globalTimeline.timeScale(0.5); //plays at half-speed
gsap.globalTimeline.timeScale(2); //plays twice the normal speed
var currentTimeScale = gsap.globalTimeline.timeScale(); //returns the current global timeScale