I'm looping through elements inside a scrambler
and applying an animation to each one using wait
, so that they appear one after another.
When I switch to another browser tab and then come back, the animation of the first element freezes and doesn't continue when I return to the tab.
I tried using the pauseOnBlur
parameter, but it didn't help.
Only when I added this line:
Ticker.setTimingMode("timeout");
the animation no longer freezes and works as expected.
My question is:
Would it be better to listen for a blur event and switch to "timeout"
only when the tab loses focus, then switch back to "requestAnimationFrame"
when the tab regains focus?
Or is it okay to just leave it set to "timeout"
all the time?