Hello,
I've been working on a project using GSAP for filtering and hiding items in a grid layout (filtering like the one on the jQuery.isotope plugin).
The grid is put in a container that has one instance of TimelineLite that I reuse each time the filtering is triggered.
This is what I have:
this._timeline.progress( 1 ).kill().clear( true )
.to( hide, 0.2, {
autoAlpha: 0,
y: -30,
onComplete: function() {
// my code here
}
})
.staggerFromTo(
show, 0.2,
{ opacity: 0, y: -30 },
{ autoAlpha: 1, y: 0, clearProps: 'visibility,opacity,y' },
0.1, '+=0',
this.options.afterFilter, null,
this.options.afterFilterScope ).play();
In this code, hide are the items to be hidden and show are the items to be shown.
The question is, I'm not sure whether the code I'm using on this grid is free from memory leaks, free from uncompleted animations (where an item has only say 40% opacity or hangs halfway because the y property hasn't finished animating) and that all callbacks are called when a user triggers this piece of code very quickly.
Here's the live example (a WordPress theme):
http://wp.youxithemes.com/helium/
Thank you!