Jump to content
Search Community

Gsap on inline Block

Gazzawazza test
Moderator Tag

Recommended Posts

Hi - hopefully not too daft a question but I cant figure how to get the divs to open from top to bottom while keeping the list <li> inline at the top.
In other words the x3 red drawers should stay inline at the top while the content div opens downwards.

I guess Im missing the blindingly obvious but I just can see it...

Thanks for any help given

gareth

See the Pen MWyrzGg by Gazzawazza (@Gazzawazza) on CodePen

Link to comment
Share on other sites

Wow.. 

First of all thanks for your quick response and answering my question.

Second.. cant believe I missed that... 

Whoops. 

 

Not surprised I'm making common mistakes though will read the article you sent. Much appreciated. Would you give me an indication to which mistakes I'm making please?? 

 

 

 

Link to comment
Share on other sites

Hi, Ive been reading through the common mistakes - still have some to rectify such as storing numbers in strings.

However, Im confused how to pass a variable into the timeline.
I am using $Work = $this.find("ul.List-Prices-Three > li"); within a .on Click event and then calling play()


The closest I have got is to call tl1.play(0); from the function play1(); which is outside of the click event

$Work passes into play1(); ok but I cannot figure how then to pass $Work into the timeline which is outside of the play1(); function


 

 

 

Link to comment
Share on other sites

Your $Work variable is inside of your click function which means it can't be accessed outside of that function. I think you'd learn a lot from my article about animating efficiently, especially the section about loops and the section about control methods. It might also be helpful to not use jQuery as it abstracts some things which make understanding what's going on more difficult. It is, of course, possible with jQuery but just a little harder to think through because of what jQuery does for you.

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.
×
×
  • Create New...