Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CoolSlider(fieldName, sliderOptions, currentOption, element) {
- range = $R(0, sliderOptions.size() - 1 );
- var fieldName = fieldName;
- var sliderOptions = sliderOptions;
- var currentOption = currentOption;
- var element = element;
- var slider = new Control.Slider('handle-' + this.fieldName, 'slider-' + this.fieldName, {
- increment: 41,
- range: range,
- values: range.toArray()
- });
- this.slider.options.onChange = function(value) {
- changeOptionTo(value);
- };
- function changeOptionTo(newOption){
- this.element.removeClassName('option' + this.currentOption);
- this.element.addClassName('option' + newOption);
- this.element.currentOption = newOption;
- };
- };
Add Comment
Please, Sign In to add comment