Jump to content
Search Community

Tween in rollover

julien94270 test
Moderator Tag

Go to solution Solved by Jonathan,

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

  • Solution

Hello julien94270, and Welcome to the GreenSock Forum!

 

Here is a simple example that animates the color on hover:

 

See the Pen zKEsj by jonathan (@jonathan) on CodePen

 

It uses jQuery to bind the hover events using mouseenter and mouseleave

// Hover events
$(document).on("mouseenter", ".bt", function(){
  
    var $this = $(this);  
    TweenMax.to($this, 0.9, {backgroundColor:"red", ease:Power4.easeInOut});
  
}).on("mouseleave", ".bt", function(){
  
    var $this = $(this);  
    TweenMax.to($this, 0.9, {backgroundColor:"green", ease:Power4.easeInOut});
  
});

:

To get familiar with codepen.. Here is a video tut by GreenSock on How to create a codepen demo example.

 

Also are links to the:

 

CSSPlugin Docs: http://greensock.com/docs/#/HTML5/Plugins/CSSPlugin/

 

TweenMax Docs: http://greensock.com/docs/#/HTML5/Animation/TweenMax/

 

Does that help? :)

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