Note: this plugin isn't currently finished. It is in a very alpha state. An implementation of very similar code is used in one of my commercial products.
jQuery Interconnected Sliders is a tool to create sets of sliders that add up to a defined value -- a way of representing user controlled proportions of a fixed resource (say a percentage, a distribution of money or any other constrained value spread over multiple categories).
jQuery Interconnected Sliders is dependent on jQuery and $.noUiSlider. We use noUiSlider instead of jQuery UI Slider both because of weight and out-of-the-box appearance.
- Create the regions for your sliders ("parent regions").
- Call $(".parentRegions").interconnectedSliders(options);
- You're done. They're now interconnected sliders!
TODO.
Note that in the above example, the sliders add up to 100. If a user changes any element, the others will update automatically (while locked sliders won't move). At all times (after all movements), the sliders will add up to their target value.
- This is currently incomplete!
Please retain this notice in ALL redistributions as well as a link back to the original repository.
Copyright 2013 Giuseppe Burtini https://github.com/gburtini
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.