run function in the next animation frame (with fallback)