jnhltmn Posted November 13, 2019 Share Posted November 13, 2019 I set the visibility of my elements on 'hidden' with css and on the start of my GSAP 3 timeline I want to set the visibility at visible. It works in a single tween, but when it's part of a timeline it doesn't. What's wrong with my code below? var tl = gsap.timeline(); tl.set(".class", {visibility:"visible"}); See the Pen dyygPob by jnhltmn (@jnhltmn) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted November 13, 2019 Share Posted November 13, 2019 Hey jnhltmn, Interesting edge case. If you add a tween after the .set() call it will work as you expect it to. But since there's no tween, the timeline has a duration of 0 and therefore doesn't even play. @GreenSock would you consider this a bug? It's an extremely rare circumstance since most people would just use a gsap.set(), not a timeline.set() if there's not other tweens... Also @jnhltmn, if you're tweening from visibility: hidden know that you can just tween autoAlpha instead of opacity and it will automatically set the visibility to visible for you. 1 Link to comment Share on other sites More sharing options...
jnhltmn Posted November 13, 2019 Author Share Posted November 13, 2019 Thanks a lot Zach! I wanted to add more tweens after making the elements visible, so I got stuck at the first tween of my timeline! And yes, I was aware of using autoAlpha instead, but I tried to understand what was wrong with my code in the first place. Thanks for clearing that out! 2 Link to comment Share on other sites More sharing options...
GreenSock Posted November 17, 2019 Share Posted November 17, 2019 I'm so sorry - the email notification for this thread wound up in my junk mail filter and I'm just seeing it now. Yes, I'd consider this a bug - it should be fixed in the next release which you can preview at https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-latest-beta.min.js Thanks for reporting it. Sorry about the confusion that caused. 2 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