Share Posted January 24 Hi, I wil fade in the text1 class when it moves. I have set the whole class to hidden but then nothing happens. What is wrong with my code? Cees See the Pen dyZbgXJ by ceescoenen (@ceescoenen) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted January 24 You are probably looking for autoAlpha, which you can read about in the CSSPlugin docs. So you need to visibility to hidden and opacity to 0. Quote autoAlpha Identical to opacity except that when the value hits 0 the visibility property will be set to hidden in order to improve browser rendering performance and prevent clicks/interactivity on the target. When the value is anything other than 0, visibility will be set to inherit. It is not set to visible in order to honor inheritance (imagine the parent element is hidden - setting the child to visible explicitly would cause it to appear when that’s probably not what was intended). And for convenience, if the element’s visibility is initially set to hidden and opacity is 1, it will assume opacity should also start at 0. This makes it simple to start things out on your page as invisible (set your CSS visibility: hidden) and then fade them in whenever you want. See the Pen yLPBZJy by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Author Share Posted January 24 Thank you @OSUblake! 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