script.aculo.us 创建滑块
滑块是一种小轨道,您可以沿着它滑动手柄。它转化为一个数值。使用 script.aculo.us 的滑块模块,您可以创建具有大量控制的滑块。
句法:
new Control.Slider( handle, track, {options} );
滑块选项: Options Description Axis Range sliderValue Values Disabled setValue setDisabled setEnabledCan be used to set the axis of the slider i.e. horizontal or vertical. Defaults to horizontal. Can be used to set the range of the slider. Can be used to set the initial position of the slider. The default location is the initial value of the range. Can be used to set the discrete values the slider can take in its range. Can be used to create a slide that is initially disabled. Can be used to set the value and position of the slider. Can be used to disable a slider. Can be used to enable a slider.
回调选项: Options Description onSlide onChangeTriggered whenever the slider is dragged. The function gets the slider value as its parameter. Triggered whenever the slider value is changed. The function gets the slider value as its parameter.
例子:
HTML
输出: