Jump to content
Search Community

Can we move object without CSSPlugin?

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

Hi, probably an easy question for most of you, but I searched a lot and I didn't find anything (english isn't my first language so...)

 

I'm obviously a new user of GSAP and I saw uses of x and y properties used to move an object, is it possible to do it without CSSPlugin?

 

Maybe I should put this question in banner section, because I would like to only use TweenLite.js for banner ads, a matter of very restrictive weight in multiple platforms Ads Exchange campaign.

 

In short, I mostly want to know what I can do with TweenLite.js only. Can we move object like this TweenLite.to(element, duration, {x:200}); ?

 

And last question :  Is it better to use .delay() to create a kind of timeline or we can chain tweens in each onComplete for the next one.

 

My test didn't work at all for onComplete but I need a confirm to be sure I didn't made a mistake.

 

Thank you for your attention

Link to comment
Share on other sites

Hi jecko.jim  :)

 

- yep it's possible , but you need to define CSS Vendor Prefixes for every browser / for every property , and you will lose some controls / performance , so i don't think that's worth to do .

 

- yep you can chain tweens with onComplete or delay but you will lose timeline power / controls , so again i don't think that's worth to do, after all , it's depend on your scenario .

Link to comment
Share on other sites

How punitive are we talking here? If you're in the realms of the 40kb, get ready for a world of pain...

 

You will probably have to make do with much, much, much simpler animation, use CSS transitions or consider a more limited/lighter library.

 

OR

 

You could (should) push back and explain the pros of using CDN for Greensock, then you can use the whole suite of tools without breaking a sweat and deliver amazing results even with those punitive file restrictions.

 

Have a read here. Specially the bit that it explains about CDNs and why use them.

Link to comment
Share on other sites

Just to throw my hat in the mix,

 

Regarding your question.. "is it possible to do it without CSSPlugin?"

 

Yes.. you could also use the GSAP AttrPlugin:

 

Example:

See the Pen bVdXbo by jonathan (@jonathan) on CodePen

  • TweenLite is 9kb and the CSSPlugin is only 15kb
  • TweenLite is 9kb and the AttrPlugin is only 1kb

Just something to think about :)

  • Like 2
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...