JavaXT
|
|||||||||
Slider ClassHorizontal slide control. Can be used as a range slider, play control, etc.
Here's a simple example of how to instantiate the slider using an existing div (DOM element) and a minimal config. See config settings for a full range of options. var slider = new javaxt.dhtml.Slider(div, { units: "percent" });Once the slider is instantiated you can call any of the public methods. You can also add event listeners by overriding any of the public "on" or "before" methods like this: slider.onChange = function(value){ console.log(Math.round(value)+"%"); }; slider.setValue("50%"); ConstructorsUsed to instantiate this class
Config Optionsdisabled If true, the slider will be disabled when it is initialized. The slider can be enabled and disabled using the enable() and disable() methods.
units Used to define the unit of measure for values returned by the getValue(), onChange(), and onDrag() events. Options are "pixels" (default) and "percent".
style Style for individual elements within the component. Note that you can provide CSS class names instead of individual style definitions.
EventsPublic MethodssetValue( x, silent ) Used to set the position of the slider. Note that the update will be deferred until the slider is rendered.
|