Jump to content
GreenSock

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

onUpdate is never called when seek()ing a paused timeline

Recommended Posts

Bug or feature? When I tl.seek() a paused timeline the animation is "updating" yet the onUpdate function is never called. See plunk.

See the Pen cplhI?editors=101 by gilbox (@gilbox) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Thanks a lot for the demo. Super helpful.

 

2 problems

 

1. your update2 function is logging 'update1'

 

function update1() {
  console.log('update1');
}
function update2() {
  console.log('update1'); //oops
}

obviously a simple typo. no problem.

 

However the big problem is that seek() takes a second parameter called suppressEvents which is true by default. 

Set that to false and you should be good to go

function intv() {
  tl2.seek(t2 += 0.01, false);
}

seek() : http://greensock.com/docs/#/HTML5/GSAP/TimelineLite/seek/

 

demo: http://codepen.io/anon/pen/vmnAu

  • Like 2
Link to comment
Share on other sites

You're welcome.

And no worries, there are a lot of subtle nuances like "suppressEvents" that you can only really appreciate when you need them.

 

Thanks for sharing the links to spark-scroll. I have yet to get deep into Angular, but wish you great success with the project.

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