Currently, we have our scrolling content whenever our moses' on top of the element that contains the
content, then we stop the scrolling from happening.
We've also created a button that we can stop and start the scrolling.
And we also have a scroll speed input up here.
So let's activate those in this lesson.
Opening up our ED, we can select instead of getting scroll speed, we can select the scroll speed from
the input directly as we've already set it up as an object within our reach, within our JavaScript
so we can take our speed object and set our scroll speed to be speed value.
So now as we decrease the value, the speed will decrease.
As we increase it, the speed of the scrolling can increase as well.
Let's also update and activate our button so we've got our button element that we created initially.
We added an event listener for that button, and right now all it's doing is click.
So we've got a number of things that we can do with it.
There are several ways to toggle evalu so I going to show you one and we can use the uptick in order
to do this.
This is the shift six.
Equals and we can set it to true, so see what happens whenever I click the button, it's going to actually
toggle that effect so we can turn that on and off.
And we can also read started whenever we click.
We can also update the value that's contained within the button.
So selecting the button.
We could update our entire text of the button, whatever the value of scroller is, and if we want to
get the boolean value, we can output it this way.
So going back to click, it's Bulleen one or zero.
So right now it's zero.
Now it's one and so on.
So it's going to update it to be.
So right now scroller is off then scrolling on, scroll off, scroll on.
Or we could use a territory operator where we check to see the value of scroller.
And just as we used down here, we can return back either or stop.
So let's try that out and click.
And actually, that should be backwards.
So we can negate that and now we can have it to start again and stop whenever we want, and this way
we can update the button values as well.
So go ahead and try this one out for yourself.
And remember, this is the optics of this shift.
Six on most keyboards is going to give you this character.
And what this does is it allows you to convert a number.
So this is a bitwise XOR assignment operator.
So what it's doing is it's toggling the value.
So if it's equal to true, then it's going to be false.
If it's equal to false.
It's going to change the truth.
So it's toggling that assignment.
Operator And this is a quick way that you can update those boolean values of your variables.
So try it for yourself.