1
00:00:00,060 --> 00:00:01,560
How's it going so far?

2
00:00:01,590 --> 00:00:05,430
Do you have your images, are they rotating every three seconds?

3
00:00:05,640 --> 00:00:07,330
Are your dots clickable?

4
00:00:07,350 --> 00:00:14,280
OK, quick trick question, because right now, as we've left the script off, we are only outputting

5
00:00:14,280 --> 00:00:17,590
the index value of the image that we want to show.

6
00:00:17,610 --> 00:00:20,540
So we need to take care of that and we need to update that code.

7
00:00:20,880 --> 00:00:24,110
So going into where we've got our move slides function.

8
00:00:24,450 --> 00:00:26,260
So it's the one right here at the bottom.

9
00:00:26,280 --> 00:00:29,190
Right now, all we're doing is console logging out the number.

10
00:00:29,370 --> 00:00:35,910
And this is going to be a very easy fix where we take their slight index and we call out to them because

11
00:00:35,910 --> 00:00:38,280
remember, the slide index is a global variable.

12
00:00:38,550 --> 00:00:41,930
We need to clear the time out counter.

13
00:00:41,940 --> 00:00:43,440
So this is clearing the time out.

14
00:00:43,650 --> 00:00:50,070
So the same timer that we set over here, all we need to do is clear that out so that that stops running

15
00:00:50,220 --> 00:00:53,150
and then we need to play slides once again.

16
00:00:54,240 --> 00:00:54,930
Let's try that.

17
00:00:55,200 --> 00:01:00,570
And now whenever we click one of these, so we'll see that it's rotating every three seconds.

18
00:01:00,750 --> 00:01:03,240
But wait, we want to go back to image number one.

19
00:01:03,240 --> 00:01:06,150
So we click the first one and we end on image number one.

20
00:01:06,360 --> 00:01:07,620
And now we want to see three.

21
00:01:07,770 --> 00:01:08,880
Now we want to see two.

22
00:01:08,880 --> 00:01:10,860
We'll see one again, three to one.

23
00:01:11,010 --> 00:01:16,170
And we can manually override the automated movement of our slide.

24
00:01:16,350 --> 00:01:19,710
And then as soon as we leave it, it picks up where it's left off.

25
00:01:19,860 --> 00:01:26,670
So if we move it back to one, then it picks up again in slide number one, we see it for three seconds

26
00:01:26,670 --> 00:01:28,980
and then moves to two, three and so on.

27
00:01:29,250 --> 00:01:31,370
So all of the functionality is there.

28
00:01:31,710 --> 00:01:37,530
Add this into your project and the next lesson, we'll do a quick code review just to make sure that

29
00:01:37,530 --> 00:01:39,780
everything is working as intended.
