GreenSock FAQs
FAQS
FAQs
Can I use the JavaScript version of GSAP for canvas objects or 3rd party tools like EaselJS?
Which browsers work with the JavaScript version of GSAP?
GSAP itself is pure JavaScript and should work in virtually ALL browsers. GSAP wasn’t intended to solve all browser incompatibilities, but it does implement wizardry for critical features like opacity
, transforms (rotation, scaleX, scaleY, skewX, skewY, x, and y
), and transformOrigin
so those should work in all major browsers even back to IE6. Firefox doesn’t support backgroundPositionX
or backgroundPositionY
, so those specific properties won’t work but backgroundPosition
will for virtually all browsers. There is NOT a predetermined list of css properties that you can tween – the platform will attempt to tween ANY property you pass in. If it is numeric, it will tween it. If it isn’t numeric and it isn’t a recognized special property, CSSPlugin will just set the property to the value you provide (without tweening it). So, for example, if you try to tween to display:"inline"
, that isn’t a tweenable property but it will still be set accordingly during the tween, so feel free to use that to your advantage.
Does the JavaScript version of GSAP use CSS3 transitions to deliver even better performance (with help from the GPU)?
CSS3 transitions have some significant limitations that make them unworkable for a serious animation platform. They don’t provide precise controls over the timing or easing. They’re great for simple effects but the GreenSock Animation Platform delivers extremely precise rendering, so you can do things like pause() and reverse() an animation anytime or skip to a specific time and play from there, etc. Try creating a CSS3 transition that uses an elastic.out or slow motion ease and then jump to 0.72494-seconds into a 2-second transition and pause() only to resume() later. It’s impossible from what I understand. So no, the platform doesn’t make use of CSS3 transitions. However, it is highly optimized for performance. See the detailed cage match where GSAP battles CSS3 transitions where there’s a detailed comparison in several categories.
Do I need to worry about garabage collection in the JavaScript version of GSAP? What happens when a tween finishes?
No need to worry. Tweens and timelines are automatically made eligible for garbage collection (gc) when appropriate (typically when they finish but if you maintain a reference to an instance so that you can restart it later, for example, it won’t be gc’d out from under you). Basically the system manages gc for you and generally cleans up after itself.