Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
garyw

Repeating delayedCall?

Recommended Posts

I have code that uses a className tween on repeat:

 

TweenMax.to(buttons, PULSE_INTERVAL, {className:'-=pulse', ease:SteppedEase.ease.config(1), repeat:-1});

 

This toggles the "pulse" CSS class on and off. I know that the className tween is no longer supported. Is there a way to repeat a delayedCall in order to do this?
 

Share this post


Link to post
Share on other sites

Same concept as v2.

 

gsap.to(buttons, {
  duration: PULSE_INTERVAL,
  repeat: -1,
  onRepeat() {
    // do stuff
  }
});

 

  • Like 3

Share this post


Link to post
Share on other sites

Don't know how you're adding the class names, but to remove them would be like this.

 

gsap.to(buttons, {
  duration: PULSE_INTERVAL,
  repeat: -1,
  onRepeat() {
    this.targets().forEach(button => button.classList.remove("pulse"));
  }
});

 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×