Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Vahid-Designer

Infinite Number of repeats by TweenLite

Recommended Posts

Hello everybody. I am using the TweenLite together with TimeLineLite currently and I think that's much easier to use and can replace it instead of css3. But I have many dive that they are circles (border-radius:50%) and they rotate 360 degree infinitely.  I have tried do that via gsap using TweenLite but unfortunately it hasn't any predefine method to do this (TweenMax has repeat property which we can assign a large number for it and simulate infinitely). Does anyone any Idea to help me do this via TweenLite ? because of being lightweight and the fact I'm using jQuery I can't use TweenMax anymore,

 

Thanks For Your Helps.

Link to comment
Share on other sites

Hi Vahid-Designer :),

 

Welcome to the forums. You could try something like this:

function forever() {
TweenLite.to(yourObject, 1, {rotation:"+=360", ease:Linear.easeNone, onComplete:forever});
}

forever();

Hopefully this helps a bit.

:)

  • Like 2
Link to comment
Share on other sites

Why can't you use TweenMax with jQuery? You still need the CSSPlugin to do rotation, and that's almost half of TweenMax's file size.

 

Here you go... 90 bytes

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenMax.min.js"></script>
  • Like 1
Link to comment
Share on other sites

 

Why can't you use TweenMax with jQuery? You still need the CSSPlugin to do rotation, and that's almost half of TweenMax's file size.

 

Here you go... 90 bytes

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenMax.min.js"></script>

Thanks for replay. But if I wouldn't help of gzip I need 105kb for TweenMax (without CDN) which I can use TweenLite and TimeLineLite wth using CSS Plugin instead. It's size will be 79kb. I can save 27kb by using TweenLite.

But if I decided zip it, therefor TweenMax will be 35kb and {TweenLite + TimeLineLite + CSS Plugin} will be 33kb. So it's better to use TweenMax.

So if I decided to use zip file I do your advice. Thanks. But at the moment, pointC solved my problem.

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