Closed martin-c0des closed 10 years ago
This is probably due to RequestAnimationFrame, which is letting the browser tell the program when it's ready to draw the next frame. It makes sense for RAF to not fire when the browser tab does not have focus, since that would be rendering frames that are never displayed.
You may need to look into using a Tween engine with more sophistication, like GreenSock Animation Platform (which has a Kinetic Plugin and a Timeline object, which is handy for coordinating many different tweens that need to work together, etc)
-----Original Message----- From: "Martin Velchevski" notifications@github.com Sent: 5/29/2014 3:55 PM To: "ericdrowell/KineticJS" KineticJS@noreply.github.com Subject: [KineticJS] Tween not animating when it's browser window loosesfocus. (#943)
So I have a tween which I'm calling each second with setTimeout()... Everything works like a charm, however when I switch to another tab and wait for some time to pass, upon returning to the tween tab the animation continues from where I left off. Is there any way around this? I really want to stick with KineticJS! :) — Reply to this email directly or view it on GitHub.
Hey @jfollas thank you for the quick reply man! I was quite sure RAF was causing the trouble, however I was secretly hoping there's some sort of workaround within Kinetic itself. I would most certainly look into GreenSock. Thank you for your suggestion once again!
So I have a tween which I'm calling each second with setTimeout()... Everything works like a charm, however when I switch to another tab and wait for some time to pass, upon returning to the tween tab the animation continues from where I left off.
Is there any way around this? I really want to stick with KineticJS! :)