Jump to content
Search Community

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'm trying to figure out why my right column doesn't expand properly when "hide" button is clicked. Both left and right columns are floating left; left column ranges from 20% width to 0 %; right column ranges from 80% width to 100% respectively. 

 

Looks great when "show" is clicked, but there seems to be a floating/width issue when "hide" is clicked.

 

This seems like it should be simple, but I can't figure out what I'm doing wrong...

 

Thanks a trillion.

BC

See the Pen qdXxPe by bcato3000 (@bcato3000) on CodePen.

Posted

Hi Cato  :)

 

if i understood correctly what's your problem , pls use width:'0%' , btw , you can try another simpler way too :

var T = new TimelineLite({paused:true})
T.to($('.left'),0.5,{width:'0%',}).to($('.right'),0.5,{width:'100%'},0);

$('.show').click(function(){T.reverse()});
$('.hide').click(function(){T.play()});

or even simpler , just with one Btn to toggle your Tween / Timeline , like this : 

See the Pen Pwzomo by GreenSock (@GreenSock) on CodePen.

  • Like 2
Posted

Ah, I knew it would be something simple! Thanks for your help, D.AW

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