Jump to content
Search Community

Starting from random positions.

rgfx test
Moderator Tag

Go to solution Solved by lunelson@gmail.com,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I wanted to stagger in a none linear manner. Animate elements randomly. Messed around with a loop and random delays, but I think timeline wont loop until is done. Stagger and TweenMax didn't seem to work inside my loop using my variable, surely a lack of skill is involved. 

 

Wonder if its possible without animating each element individually. 

 

Thanks. 

See the Pen ByZeRB by rgfx (@rgfx) on CodePen

Link to comment
Share on other sites

Hi Guys :)

 

rgfx , i think with random durations you can have more effective tweens :

function getRandomInt(min, max) { return Math.random() * (max - min) + min; }

var tl = new TimelineMax();

$(".item").each(function(){
  var dRand = getRandomInt(0,0.7);
  tl.to($(this), dRand, {autoAlpha:1, delay: dRand, ease:Power4.easeInOut});
});
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...