Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
jecko.jim

Can we move object without CSSPlugin?

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 post
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 post
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 post
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 post
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.

×