Priska Posted December 6, 2019 Share Posted December 6, 2019 Before I could use the tween.target property to access the object, this.innerTweenID = TweenMax.to(this.obj, 1.2, { y: this.scrollTo, ease: Power4.easeOut, onUpdate: tween => { const scrollTop = Math.round(tween.target.y) } }) How about now ? The documentation is full of examples but never talk about that point.... PLEASE HELP ! Link to comment Share on other sites More sharing options...
elegantseagulls Posted December 6, 2019 Share Posted December 6, 2019 Is this what you're looking for? https://greensock.com/docs/v3/GSAP/gsap.getProperty() 2 Link to comment Share on other sites More sharing options...
ZachSaucier Posted December 6, 2019 Share Posted December 6, 2019 You can access the target by using this.targets() in GSAP 3 (arrow functions are always locked into the scope they're created then so don't use them if you're trying to use this). So you can do this.targets()[0] to get your element: onUpdate: function() { const scrollTop = Math.round(gsap.getProperty(this.targets()[0], "y")); console.log(scrollTop); //... }, .getProperty() could also be used as elegantseagulls mentioned. 2 Link to comment Share on other sites More sharing options...
Priska Posted December 7, 2019 Author Share Posted December 7, 2019 Great guys!! ? Thank you for the quick replies. ?? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now