Skip to content

requestAnimationFrame background handling #176

Closed
@Rycochet

Description

@Rycochet

I've got to make a really irritating little site (don't blame me - clients etc lol), which needs animation going pretty much all the time, including creating dynamic elements, animating them in, then animating them out again a short while later (too dynamic to just toggle sadly).

Sadly the downside to requestAnimationFrame is that when the animation is wanting to happen on a background window/tab it doesn't actually happen - resulting in me going back a while later to find hundreds of new elements that animate out almost immediately.

I've been thinking about what's best to do - and can easily check if the tab is active for starting things etc, but how about an option (possibly) to setTimeout the end time, and if the animation hasn't been called (or it's in the background etc) then call complete() and set the final values?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions