Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set repeat to infinity? #43

Closed
mvaneijgen opened this issue Oct 13, 2016 · 5 comments
Closed

How to set repeat to infinity? #43

mvaneijgen opened this issue Oct 13, 2016 · 5 comments
Labels

Comments

@mvaneijgen
Copy link

repeat: 20 option allows you to run the animation of given tween multiple times. The default value is 0.

Doesn't talk about it, should I just set it to 999999999999?

http://thednp.github.io/kute.js/options.html

@thednp
Copy link
Owner

thednp commented Oct 13, 2016

It has to stop somewhere currently set to 9999 max limit. But why Infinity really?

@mvaneijgen
Copy link
Author

I have a wave (as in water) animation on a page which for me doesn't need a limit, but 9999 is fine. Otherwise my bounce rate will be amazing which will probably be not the case.

Thanks for the response.

thednp added a commit that referenced this issue Dec 11, 2016
* fixing SVG transforms for good #33
* major changes to the tween objects #39
* back to Infinity repeat #43
* all round performance improvements
thednp added a commit that referenced this issue Dec 11, 2016
* fixing SVG transforms for good #33
* major changes to the tween objects #39
* back to Infinity repeat #43
* all round performance improvements
@saranshdhingra
Copy link

I am actually updating my site from GSAP to kute.js and I have a very similar requirement to yours.
Here is my site: http://theta.crazyripples.com/

Here is what I did to achieve infinity:

var tween=KUTE.fromTo(obj,
			{rotate:0},
			{rotate:359},
			{
				duration4200,
				repeat:0,
				complete:function(){
					tween.start();
				}
				
			}
		).start();

@thednp
Copy link
Owner

thednp commented Jan 25, 2017

No worry men, I initially set a number like 99999 hoping to solve some recursion, but I found the problem, it was something 1.5 series introduced in the plugins and KUTE.js 1.6 series reintroduces Infinity repeat.

@Skayona
Copy link

Skayona commented Dec 24, 2018

For me works next:

const tween = KUTE.to('#wave-1', {
    path: '#wave-2'
  }, {
    duration: 1500,
    repeat: 1,
    yoyo: true,
    easing: 'easingCubicOut'
    update: function () {
      if (!tween.options.repeat) {
        tween.options.repeat = 1;
      }
    }
});
tween.start();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants