Fixes animations failing when browser tab not visible.