Using Sliders with the Scriptaculous Framework - Coding a basic vertical slider with the Scriptaculous framework (Page 2 of 4 )
As I explained in the beginning of this tutorial, including a DHTML slider within a given web document can be accomplished with minor efforts. The procedure is limited to using the "Control.Slider" object that obviously comes bundled with the Scriptaculous framework.
The first example that Iím going to show you covers the implementation of a basic vertical slider, whose look and feel is depicted in the screen shot below:
As you can see, the DHTML slider shown above is quite appealing. It features two primary elements, its sliding track and the respective handle. However, now that you have seen how this control looks, let me show you the corresponding (X)HTML file that displays this element in a conventional web page.
The respective code sample is as follows:
As I said before, the inclusion of this DHTML control is performed by using the "Control.Slider" object that comes integrated with this software. The object accepts some intuitive parameters, such as the ID's values that correspond to the handle and the sliding track of the slider respectively (in this case I used two DIVs to contain these elements). It also specifies its alignment via its "axis" argument.
You can see that I specified a couple of additional parameters for the slider, including its minimum and maximum values, and the vertical offset of its handle, via the "alignY" argument. Quite simple, right?
Of course, it should be noticed that itís possible to specify even more input arguments for a concrete slider, but these extra features will be covered progressively in subsequent hands-on examples.
All right, at this point you have seen how to include a simple vertical slider into a given web document via the powerful "Control.Slider" object that comes packaged with the Scriptaculous animation framework. Therefore I believe that itís a good time to go forward and explore other controls integrated with this package, in this case to see how to code a horizontal slider.
As you might have guessed, the process will be closely similar to the one just described a few lines above, but it will be discussed in the following section. So, click on the link below and keep reading.