michaelvillar / dynamics.js

Javascript library to create physics-based animations
http://dynamicsjs.com
7.57k stars 414 forks source link

Transition in background tab #22

Closed baopham closed 8 years ago

baopham commented 8 years ago

Seems like transition doesn't continue if the tab becomes inactive. I suppose this is the browser thing, but is there a way to get around this?

michaelvillar commented 8 years ago

This is made on purpose. The reason is that requestAnimationFrame isn't working in background tabs. This is why dynamics.setTimeout exists too, it'll delay the setTimeout if the tab goes to the background.

One workaround would be to use setInterval when the tab goes to the background, but I don't think I'll work on this anytime soon.

Thanks!