cancel animationFrame?
See original GitHub issueHi,
I have this bit of code:
render(){
requestAnimationFrame(this.render.bind(this));
this.tl
.to(this.displacementFilter.scale, 1, { x: 75, ease: Power2.easeInOut })
.to(this.displacementFilter.scale, 1, { x: 0, ease: Power2.easeInOut });
this.renderer.render(this.stage);
}
I am using Greensock (GSAP) to tween the scale.x property of a filter, however, I just want this to be played once. So how can I render this, and cancel rAF when the tweening is done? Any tips?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
window.cancelAnimationFrame() - Web APIs | MDN
The window.cancelAnimationFrame() method cancels an animation frame request previously scheduled through a call to window.
Read more >cancelAnimationFrame · WebPlatform Docs
cancelAnimationFrame. Summary. Cancels a requestAnimationFrame request. Method of dom/Windowdom/Window. Syntax. window.cancelAnimationFrame(/* see parameter ...
Read more >Right usage of requestAnimationFrame / cancelAnimationFrame
You should send the id of the requestAnimationFrame you want to cancel into cancelAnimationFrame . That id is a return value of the...
Read more >cancelAnimationFrame - Cesium Documentation
cancelAnimationFrame (requestID). A browser-independent function to cancel an animation frame requested using requestAnimationFrame .
Read more >"cancelanimationframe" | Can I use... Support tables for ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi, You shouldn’t put your timeline tweens in the
renderloop, it will create a new tween 60 times a second! You just need to put the tween somewhere else where it’s only called once. Also, TweenLite provide an “onUpdate” callback that is called 60 times a second for the duration of the tween, so if you only want to render your scene while the scale is animated, you can put the above code in that callback.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.