loopj / jquery-simple-slider

Unobtrusive numerical slider plugin for jQuery
194 stars 113 forks source link

dynamically set data-slider-range #34

Open priteshgr81 opened 11 years ago

priteshgr81 commented 11 years ago

Hello is there a way we can set the data-slider-range dynamically ie on drop down list change????

wolendranh commented 8 years ago

You can access that in $(this).data("slider-object"); Check out source - it is possible, but not very intuitive :(

benbinesh commented 6 years ago

I have customised the slider in order to achieve it

  1. Add "setRange" Function to public methods publicMethods = ["setRatio", "setValue",'setRange'];
  2. Define the "setRange" function ' SimpleSlider.prototype.setRange = function(maxValue) { this.settings.range[1] = maxValue; }; '
  3. Call this functio as $('#slider-fsa-contributor').simpleSlider("setRange", 450);