Jump to content
Search Community

How to show the element in 3 seconds after page load?

sunnie
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Posted

I set element id="text" opacity as 0. I want it to appear in  three seconds after page load. I am using delay, but it is not working.
 

See the Pen jLYaba by sunnie19 (@sunnie19) on CodePen.

Posted

Mikel's example works great, but it also appears that switching the from() tween to a to() tween will do the trick as well

 

var tl = new TimelineMax({
    repeat: -1,
    repeatDelay: 3,
    delay:3
  });
tl.add("begin");
tl.to("#text",1,{opacity:1});

 

In your css you gave #text and opacity of 0 so you need to tween to an opacity of 1 for it to appear.

 

See the Pen mMXwyd?editors=0010 by GreenSock (@GreenSock) on CodePen.

 

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...