The slider is intuitive and easy to use, but to get any kind of workable result out of it, beyond what we've looked at so far, we'll need to make use of the methods that are built into it. The methods we can use are shown in the following table:
Method |
Used For/To |
---|---|
|
Move the thumb to the specified value on the track |
|
Retrieve the current value of the thumb |
|
Disable the functionality of the slider |
|
Enable the functionality of the slider |
|
Return the underlying mark-up to its original state |
The first two methods, moveTo
and value
, are the most specific to the slider and are essential for working with it in any sensible way. To be able to use the slider widget effectively, you'll need to at least use the value
method to obtain the position of the thumb following an interaction. Let's look at using this method next. Open slider7.html
and change the final <script>
block so that it appears as follows:
<script type="text/javascript...