susan
Junior Member
Posts: 2
Registered: 2/17/2009
Location: Cary NC
Member Is Offline
|
| posted on 2/17/2009 at 03:43 PM |
|
|
dynamically changing slide bar min, max and step
I'm looking for a solution to dynamically change the max,min and step values of a slide bar.
I've written a short function to try to do this, but I have not been having luck getting it to work. I'm not attempting to change the appearance of
the bar at all, just the working values on it. Unfortunately, I'm not sure if the problem is in my function, or in how I'm calling it. Any advice
or suggestions would be appreciated!
function f_setslider(min, max, value, step){
//reset the slider values
this.n_minValue = min;
this.n_maxValue = max;
this.n_step = step;
this.n_value = value;
this.n_pix2value = this.n_pathLength / (this.n_maxValue - this.n_minValue);
}
|
|
|
susan
Junior Member
Posts: 2
Registered: 2/17/2009
Location: Cary NC
Member Is Offline
|
| posted on 2/17/2009 at 04:18 PM |
|
|
With some more experimenting, I've discovered that my code 'works' if i take it out of the function and put it directly in my script. I can't
seem to call any of the slidebar functions from my script successfully. So my problem may be more an issue with javascript function calls than the
slidebar class.
works:
A_SLIDERS[0].n_minValue = 10;
A_SLIDERS[0].n_maxValue = 300;
A_SLIDERS[0].n_step = 100;
A_SLIDERS[0].n_value = 1;
A_SLIDERS[0].n_pix2value = A_SLIDERS[0].n_pathLength / (A_SLIDERS[0].n_maxValue - A_SLIDERS[0].n_minValue);
doesn't work:
A_SLIDERS[0].f_setslider(10, 300, 100, 1);
A_SLIDERS[0].f_sliderSetValue(parseFloat(values[0]);
I'm probably out of the realm of this board, but does anyone have an explanation why the function calls aren't successful?
|
|
|
|