Hi!
I'm new to GSAP (and loving it!) and I'm trying to figure out how to pass a reference to the DOM element I'm tweening to the onComplete function. I've tried the following:
TweenLite.to($("#content li")[i], 1, {top:"150%", onCompleteParams:[lmnt], onComplete:function(){
console.log(lmnt); //Uncaught ReferenceError: lmnt is not defined
}});
TweenLite.to($("#content li")[i], 1, {top:"150%", onCompleteParams:["lmnt"], onComplete:function(){
console.log(lmnt); //Uncaught ReferenceError: lmnt is not defined
}});
TweenLite.to($("#content li")[i], 1, {top:"150%", onComplete:function(){
console.log(this); //appears to be TweenLite object--instanceof HTMLElement is false
}});
TweenLite.to($("#content li")[i], 1, {top:"150%", onCompleteScope:this, onComplete:function(){
console.log(this.toString()); //[object Window]
}});
How can I pass reference the DOM element that just finished tweening? I'm trying to reset the top parameter to it's starting value so the next time it tweens it will be starting from the beginning instead of the end. Halp?
Thanks!