javascript - How can I force Jquery animations to occur when the window is not focused -



javascript - How can I force Jquery animations to occur when the window is not focused -

okay, building ajax based game. anyway multiplayer, connects server. polls server, getting updates time. anyway game has different game states, , must animate gui based on game state.

the problem is, however; when window not focused, jquery animations queue , not render. means user walks away 5 mins , comes back, huge queue of obsolete animations start run through 1 one.

so wondering if there way forcefulness jquery animations run when called , not wait focused window?

for farther info on why happens, read additional notes, in jquery documentation here http://api.jquery.com/fadein/

cheers, josh

depending on animations, add together onfocus event on body element gets animation queue calling .queue() , if it's longer 1 element, phone call .clearqueue(). of course of study you'd have careful not mess layout, since removes animations.

also seek doing jquery.fx.off = true if list longer 1 element. should set duration of animations 0, should result in of queued animations beingness finished instantly, , enable animations 1 time again, set value false. however, since haven't tried myself, i'm not sure if sets duration on animations haven't yet been run (already in queue) or on haven't yet been added queue. if latter case true, loop through queue , set each duration 0 manually.

javascript jquery ajax animation fadein

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -