Jump to content


Toggle style example

Moderator Tag

Recommended Posts

Hi, I'm trying to build a basic toggle that highlights/fills a selected box when clicked. Basically highlights the selected box. Is there an easy way to do this with GSAP without building out a load of logic using the CSS selectors ? i.e. Highlight an active selection. 

See the Pen WNgZWeZ by carlskii (@carlskii) on CodePen

Link to comment
Share on other sites



This seems to work in the way you expect:

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


Hopefully this helps.

Happy Tweening!

  • Like 1
Link to comment
Share on other sites

Perfect - thank you. Exactly what I needed. 

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.