Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Leelala

TweenMax suddenly not working

Recommended Posts

i have two frame to show, play aniframe, then will appear aniframe1. last time was working, but suddenly aniframe1 not working anymore.
 

TweenMax izit not support this code anymore?

TweenLite.to($(".aniframe1"), {css:{visibility:"visible"}});

Last time i was using this topic attachment file, to do revision.
http://forums.greensock.com/topic/7624-animatein-animateout-example/?hl=animatein

Link to comment
Share on other sites

Hi,

 

a to() tween needs a duration

 

BAD

TweenLite.to($(".aniframe1"), {css:{visibility:"visible"}});

GOOD

TweenLite.to($(".aniframe1"), 1, {css:{visibility:"visible"}});
But since visibility isn't really a tweenable properties (the only values are "hidden" and "visible"), you might just want to use set() (same as a tween with 0 second duration)
 
TweenLite.set($(".aniframe1"), {css:{visibility:"visible"}});
Also, just so you know, the css{} object wrapper is no longer necessary, you can just do this
 
TweenLite.set($(".aniframe1"), {visibility:"visible"});

If you need more help, please provide a very simple with just enough code to illustrate the problem. 

 

Here is a codepen example of the set() method discussed above:

http://codepen.io/GreenSock/pen/ab6f0040a8dc26c5913dc9dca1505d9d

 

 

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