Jump to content
Search Community

How To Animate Buttons on Hover with GSAP

jemfrim949 test
Moderator Tag

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

Hello,

 

I am a fan of the 3d button hover options under the Box Shadow section shown on this page http://www.greensock.com/css3/  I am attempting to replicate the box titled "sharp shadow" (with then end goal of moving up to the more complex box shadow features in that section)

 

Conceptually I am not understanding how to activate a hover design animation with tweens. I have attached a codepen where I have the design ready to go when the page loads; however, nothing is happening. 

See the Pen vzjDB by anon (@anon) on CodePen

 

Cheers In advance!

 

(PS Newbie)

Link to comment
Share on other sites

First, thanks so much for creating the CodePen demo. You don't know how helpful that is. It saves us lots of time.

 

Your original pen had one formatting error, missing a closing } or ) which was showing up in the console. Also the duration variable wasn't defined. Little stuff.

 

Here is a working version for you to play with: http://codepen.io/GreenSock/pen/IJfwE

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