Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
folktrash

Sorting animation, and height on making visible...

Recommended Posts

I've got a list of items. Filters are clickable that hide all but the items in that category with a sequence that fade opacity and height to 0. When showing all, items currently at opacity and height 0, fade in correctly, but height "pops" in immediately.

 

Am I missing something obvious here? Also, is there a more appropriate place to post than here? SO perhaps?

Link to comment
Share on other sites

I've found the set() height to auto and tween from. Trying that now...

Link to comment
Share on other sites

TL;DR: when implementing hide and show animation use-cases involving height going to 0: you'll need to switch to from() tweens on the show condition, which means you'll need to perform a set() of the properties you're "from'ing" right before you from() them. 

 

In my case, I was going to height:0, opacity:0, so on "show" I needed to set() opacity:1, height:1, and then from() height:0, opacity:0

 

While this may seem strange, it's less complicated than calc'ing heights of each items and animating to that specific value.

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.

×