Jump to content
Search Community

willemcc

Members
  • Posts

    4
  • Joined

  • Last visited

willemcc's Achievements

  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

1

Reputation

  1. That's a great approach Jack, I'll use that. Thanks a bunch!
  2. Thanks for looking into this, everyone. Your approach definitely works but still uses the "+-0.0001" workaround. I was hoping to be able to use something like ">" (https://greensock.com/3-release-notes#relative-prefixes) in this context. But I guess that's not possible. This Codepen shows our original code in context: https://codepen.io/willemcc/pen/JjdryLe For now we'll use the "+-0.0001" workaround, including your tips to simplify the code. But if you have any ideas on a more elegant approach, that would be most welcome.
  3. hi Zach, Thanks for your answer and your tips. Problem is, we need the function to be part of the timeline itself. I'll create a Codepen that'll clarify the context a.s.a.p. Thanks!
  4. Hi there, I have trouble with sequencing function calls in a timeline. This is the order in which I need things to happen: 1. Create a label 2. Pause timeline at the label 3. at click of a button, resume playing the timeline 4. Call a function I tried this: var tl_Timeline = new gsap.timeline(); tl_Timeline .add("label1") .addPause("label1") // when user clicks a button that continues playing the timeline: .call(function() { doStuffWhenTimelineContinues() }); Now, the function is called at the same time the timeline pauses. And I need it to be called later, after the timeline resumes playing. To accomplish this, I added a dummy animation with an extremely short duration, like this: var tl_Timeline = new gsap.timeline(); tl_Timeline .add("label1") .addPause("label1") // when user clicks a button that continues playing the timeline: // play dummy animation: .to(document.createElement("div"), { alpha: 0, duration: 0.0001 }) // call function .call(function() { doStuffWhenTimelineContinues() }); This works. The function is called after the timeline resumes playing. Yay! But surely there’s got to be a better, less hacky, way of doing this? Thanks for any thought on this!
×
×
  • Create New...