Jump to content
Search Community

Set duration has no effect for me

_HelloWorld_ 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

I am trying out the gsap animation library. According to the basic docs the syntax for getting a tween up and running is:



TweenLite.to( [target object], [duration in seconds], [destination values] )

So I have tried a really simple tween based on jQuery's hover event:



$('.contact-item').hover(function(){
TweenLite.to(this,4,{background:'#671B4B'});
},function(){
TweenLite.to(this,4,{background:'#FFFFFF'});
});

Oddly, the background does change to the correct color, but it tweens instantly instead of over the course of 4 seconds as I have specified in the second argument.


I did check to make sure the default is seconds not milliseconds. It's in the docs I linked to.


I did make sure I am using TweenLite and not TweenMax.


I am using jQuery but see no conflicts or errors in the console.


Any help is appreciated. I have linked to a codepen


I have added the css plugin and it is added to the codepen as well.


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

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