lzy100p Posted February 1, 2021 Share Posted February 1, 2021 hi, I am an old user, I have been using the old version 2.0 before。 I need to migrate my project to 3.0,I found some problems TweenMax.to(d1,"1",{x:110}) //Writing it this way will throw an error:Uncaught TypeError: Cannot use 'in' operator to search for 'duration' in 1 //2.x No problem gsap.to(d1,{x:110,duration:"1"}) //No problem writing with gsap It's not a big deal, but it's not compatible with the old project, but hopefully it will behave consistently like the old version thanks gsap v:3.6.0 Link to comment Share on other sites More sharing options...
elegantseagulls Posted February 1, 2021 Share Posted February 1, 2021 1 hour ago, lzy100p said: TweenMax.to(d1,"1",{x:110}) I believe this is throwing an error because you're using a string for the duration value instead of an int. TweenMax.to(d1, 1, { x: 110 }) should work in v3 via its compatibly checks. 3 Link to comment Share on other sites More sharing options...
ZachSaucier Posted February 1, 2021 Share Posted February 1, 2021 Yeah, a duration should always be a number in both the old and current versions of GSAP. We do some type converting as a convenience but you should stick to numbers Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now