3

I am having a bit of an issue with regards to jQuery sliders. I've looked around on here at several examples where people seem to be asking the same question but the approved answers given never achieve what they are actually asking for. I've therefore started my own thread.

I am trying to generate a set of jQuery sliders that have a maximum total value of 1500. If one slider (sliderA) is moved to 700, the maximum total value of the other sliders (B,C,D) must be adjusted to 800. This is fine if none of the other sliders have already been moved and are at zero as the code found here jsFiddle does the trick to ensure that the rest of the sliders cannot go over 800 (whether it be a 400, 400, 0 or 500 , 150, 150 split). The real issue is that I need the sliders to decrease dynamically if the total value after each slider is adjusted surpasses the overall 1500 limit.

For example: I move Slider A to 900. Slider B was set to 500 to start with. Slider C was set to 300 to start with. Slider D was not set.

Sliders B and C should decrease proportionally based upon the value at slider A so that the overall total never surpasses the 1500 limit.

Any ideas?

jezzipin
  • 4,110
  • 14
  • 50
  • 94

2 Answers2

1

This is not the exact (perfect) solution you are looking for, but I think it kind of gives you an idea to get started I guess:

See it on jsfiddle.

Bhesh Gurung
  • 50,430
  • 22
  • 93
  • 142
  • Hi gurung, this is close to what I need and have already experimented and got to this sort of stage before however, with this example, when one slider is moved, the remaining total is applied to all of the other sliders as their value when really it should be set as their new limit. The main complication with this however, it that it alters the scale, which cannot happen. Thanks for your contribution however. – jezzipin Dec 22 '11 at 08:48
0

This seems like very confusing functionality. I am trying to picture what kind of user interface would need such complicated relationships between multiple sliders.

Is there a way to simplify the user interface that would perhaps avoid this issue in the first place?

Becky reamy
  • 96
  • 2
  • 11
  • Hi Becky, my client has asked for this functionality specifically. Essentially, it is part of a trade off exercise. For example, if you have a new wonder drug and the sliders represent different characteristics of the drug, you must customise how much of one element is included in the drug (paracetamol for example) whilst decreasing the other elements proportionally. – jezzipin Dec 22 '11 at 08:52