Jan Cássio
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Jan Cássio
-
-
Hello guys,
I would like to suggest this simple change in TimeLineMax.addCallback signature:
Current
TimeLineMax.addCallback(callback, position, [args], scope)
Suggestion
TimeLineMax.addCallback(callback, position, scope, [args])
I know there is a reason to this current signature, but there is some situations where you don't want to set arguments, so the usage can be more simple and clean like this
// Example var tmx = new TimelineMax; tmx.add(twm1) // current // tmx.addCallback(onTMXComplete, tmx.totalDuration(), null, this) // suggestion tmx.addCallback(onTMXComplete, tmx.totalDuration(), this)
Look the last argument can be ignored.
Of course, this same sequence, can be used for any method that needs to set scope as argument (callback, scope, args).
Sorry if I made a suggestion in a wrong place.
Thanks,
UPDATE: I forgot to add position argument.
- 1
Suggestion: change addCallback arguments order
in GSAP
Posted
Yeah makes total sense, there is a solid legacy code behind gsap (I know because I'm a heavy greensock user since Flash and I follow this project for a long time).
I personally like to register scope always, so for me is a good stuff, but this is personal and may not be good for everyone.
Thanks for the feedback Jack.
Cheers,
Jan