Answer the question
In order to leave comments, you need to log in
How to call requestAnimationFrame from a class instance?
How to call requestAnimationFrame from a class instance?
Example:
class Foo() {
animation(){
window.requestAnimationFrame(this.animation);
}
}
new Foo().animation();
Answer the question
In order to leave comments, you need to log in
If I understand you correctly, here is my September demo:
codepen.io/WispProxy/pen/YGGKdd
There is an example call.
In short, you need to pass the context.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question