• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Reset range slider values

 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I setup a slider using

jQuery(id).slider({ range:true, min: 1, max: 100, step: 1, values: [1, 100]}

After I moved the slider handles I try to reset the values:

jQuery(id).slider('option', 'min', 1); //works
jQuery(id).slider('option', 'max', 100); //works
jQuery(id).slider('option', 'values', [1,100]); //does not work!

The min and max are reset but the handles stay where they are. Is this a bug?

For single silder this works

jQuery(id).slider('option', 'value', 1);
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from the documentation it is:


[] is not an array, it means it is optional, in this case if you drop it, it acts as a getter.

So you would need to use the index.



Eric
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric.
You are right.
I was confused by the Option

Get or set the values option, after init.
//getter
var values = $('.selector').slider('option', 'values');
//setter
$('.selector').slider('option', 'values', [1,5,9]);

 
Dinner will be steamed monkey heads with a side of tiny ads.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic