Special Property: Stagger

Special Property: Stagger


The stagger property allows you to offset the start time of multiple targets in a single tween. 

In GSAP3 you no longer need the staggerTo(), staggerFrom(), and staggerFromTo() methods of GSAP2.


gsap.to('.box1', {
    y:-400,
    stagger:0.1
})


there will be 0.1 timing difference between 1st and 2nd box, and 0.1 timing difference between 2nd and 3rd, I mean each box will start 0.1 seconds after the previous one starts.


lesser the value of stagger lesser will be duration and timing get overlapped, the greater the value greater the timing difference between elements

A stagger object gives you greater control over where the staggers start from and how the timing is dispersed.


gsap.to('.box1', {
    y:-400,
    stagger:{
        each:0.2,
        from:'end'
    }
})

each:0.2 means there will be 0.2 seconds between the start of each animation. 
If instead you use amount:0.2 then all animations will start within 0.2 seconds.
from indicates"from where stagger should be started" you can have end, center, edges (this will start from both end) etc



Comments

Popular posts from this blog

CSS simple grid layout

Gsap timeline position parameters

GSAP Timelines