A
A
Alex Sveridov2016-09-21 08:44:26
Canvas
Alex Sveridov, 2016-09-21 08:44:26

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

1 answer(s)
V
Victor Belozyorov, 2016-09-21
@AlexSvenJS

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 question

Ask a Question

731 491 924 answers to any question