Switch from timeouts to browser animation callback.