Chained the animate function with a delay function.