Jump to content
Search Community

.call is not firing in TimelineMax

Jess.Park 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

I'm using Countup.js to change text vaule.

I want to fire countup function in specific position point. ("endSubSlideOut")

I did what the docs says, but it's not firing at all.

What am I doing wrong?

 

function updateDutchPrice(screenName, endVal) {
  console.log(screenName, endVal);
 
  var countUpTarget = document.querySelector(
    `#${screenName} .slideInfo.my.number.total`
  );
  const countUp = new CountUp(countUpTarget, endVal);
  countUp.start();
}
 
var SlideDutchTimeline = new TimelineMax({ paused: true });
SlideDutchTimeline.add(dutchMainToInput())
  .add(dutchMainFillInput())
  .add(dutchMainPressPayBtn())
  .add(dutchMainSlideOut("SlideScreenDutchMain"), "-=0.7")
  .addLabel("endMainSlideOut", "-=0.8")
  .add(dutchMainSlideIn("SlideScreenDutchMain"), "endMainSlideOut")
  .add(moveDutchWaves("SlideScreenDutchMain", "-=30%"), "endMainSlideOut")
  .addLabel("endDutchMain", "+=1.6")
  .add(dutchSubMainToInput(), "endDutchMain+=0.5")
  .add(dutchSubFillInput(), "+=0.5")
  .add(dutchSubPressPayBtn())
  .add(dutchMainSlideOut("SlideScreenDutchSub"), "-=0.7")
  .addLabel("endSubSlideOut", "-=0.8")
  .add(dutchMainSlideIn("SlideScreenDutchSub"), "endSubSlideOut")
  .call(
    updateDutchPrice,
    ["SlideScreenDutchMain", 14000],
    null,
    "endSubSlideOut"
  )
  .add(moveDutchWaves("SlideScreenDutchMain", "-=30%"), "endSubSlideOut")
  .add(moveDutchWaves("SlideScreenDutchSub", "-=60%"), "endSubSlideOut");
Link to comment
Share on other sites

I don't notice an obvious problem with your code, so there must be something else going on - can you please provide a reduced test case? It's difficult for us to troubleshoot without seeing the problem in context. Do you perhaps have an earlier animation that's infinitely repeating or something that'd push the "endSubSlideOut" waaaaaay back in the timeline so that the playhead isn't hitting it for a LOOOOONG time? Are there any errors in the console? 

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