Jump to content
Search Community

Opposite of random()

TrulyNewbie test
Moderator Tag

Recommended Posts

Hi, a GSAAP question I believe. So at the moment I have an animation where the divs are scattered and when they gather I want them to have a 2% margin from each other. But all divs have the same name. So I figured I’d have to do it dynamically 

Link to comment
Share on other sites

Sure, if you can provide a minimal demo we'd be happy to take a peek. 

 

It kinda depends on your setup. I'd probably make them set up initially the way you want them with the CSS determining their layout (margin) and then you could animate to x/y of 0 from a random value. Another option is to use Flip plugin which will do all the hard work for you - simply capture the current state, put them in the state you want (you could apply a class, remove inline styles whatever) and then tell Flip to animate from the previous state. 

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...