Jump to content
GreenSock

GDW

Pinned content based on section - first image show

Go to solution Solved by Rodrigo,

Recommended Posts

Hey, newbie here! I'm trying to have the first image show before scrolling, is this possible??

Any help appreciated! Thanks in advance

See the Pen eYgdgZG by rahuldev39 (@rahuldev39) on CodePen

Link to comment
Share on other sites

  • GDW changed the title to Pinned content based on section - first image show
  • Solution

Hi @GDW and welcome to the GreenSock forums!

 

Hopefully this is what you're looking for:

See the Pen OJZZwbj by GreenSock (@GreenSock) on CodePen

 

Basically the idea is to check for the first element when creating the animations in the loop and when running the getCurrentSection method, at first run the lastContent variable is undefined, so that means we have to hide the first kitten

 

Happy Tweening!

  • Like 1
Link to comment
Share on other sites

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.
×