Jump to content


Show Div with click button

Moderator Tag
Go to solution Solved by PointC,

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


I've got five Box and five buttons.

I want the first button, the display Box1    and other boxes are hidden.


Button 1 => Box 1

Button 2 => Box 2

Button 3 => Box 3

Button 4 => Box 4

Button 5 => Box 5

See the Pen Rppxzo by milika (@milika) on CodePen

  • Like 1
Link to comment
Share on other sites

I'm sorry ... I'm not sure what you are asking here. Do you want each button to display a corresponding box while hiding the others?

  • Like 1
  • Haha 1
Link to comment
Share on other sites


Like a slide show

Or a menu


or like play timeline 

Link to comment
Share on other sites

OK, I'm sorry ... I'm still not sure what you're looking for. To me, a slideshow, a menu, and a timeline could describe wildly different things. Do you have an example of something that illustrates what you're looking for?


Here is a pen showing how to easily assign button clicks to hide/show actions on specific elements.


See the Pen LWWgeb by sgorneau (@sgorneau) on CodePen

  • Like 3
Link to comment
Share on other sites

  • Solution

I was a little confused about your desired result too. If you want to tween on click, you can certainly do that. I made a quick fork of your pen to show what you can do. I left the box divs in a column just for illustrative purposes. Obviously, you can do whatever you want with them.


See the Pen xqqyaE by PointC (@PointC) on CodePen


As Shaun mentioned, an example of what you want to do would get you better answers and advice.


Happy tweening.


  • Like 3
  • Thanks 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.