Jump to content
Search Community

onStart() function fires twice on tween

Maniak Development test
Moderator Tag

Recommended Posts

Hey guys I have a very weird issue happening. First I was trying to create a CodePen but I can't replicate the issue there.

 

I created a simple code example, so I have a tween on a timeline and I need functionality when the tween starts, the problem is that the onStart() function being trigger twice for some reason. First I thought that my function was being called twice but that is not the case. I did some research and I found similar issues but way back.

Since I don't have a codepen to show, this is the example code that I have

 

nextSlide(){
  console.log('enter function')

  gsap.timeline()
    .to(this.ImageSections[this.currentSection], {
    onStart: ()=>{
      console.log('enter OnStart() Timeline')
    }
  })
}

 

And this is the console log.

So I can see my function is being trigger once, but the onStart() is being called twice for some reason

 

 

Screen Shot 2021-07-20 at 17.01.33.png

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