jQuery Linked UI Sliders Reference

A jQuery plugin that links several jQuery UI Sliders so that they always total to a given value. If you find this plugin useful please vote for it on the jQuery site.

This page provides a documentation reference for working with the plugin v1.0.0. See a demonstration of the bookmark plugin and download the code from there. Or see a minimal page that you could use as a basis for your own investigations.

Instance Settings

Customise each targetted set of jQuery UI Sliders with the settings below (all are optional):

$(selector).slider().linkedSlider({policy: 'first'});

Note that the sliders to be linked must be initialised as sliders first and must be selected as the group.

NameTypeDefaultComments
totalnumber100 The grand total for all the linked sliders.
policystring'next' The policy followed to determine the order in which other sliders in the group are adjusted to restore the desired grand total. Use one of:

  • next - the next slider in normal document order, cycling back to the start of the group when necessary
  • prev - the previous slider in normal document order, cycling back to the end of the group when necessary
  • first - always start with the first slider in the group and proceed forward through the group
  • last - always start with the last slider in the group and proceed backward through the group
  • all - distribute changes equally amongst the other sliders in the group

Functions

SignatureReturnsComments
$.linkedSliders.setDefaults(settings)LinkedSliders object Update the default instance settings to use with all linked sliders instances.

settings (object) is the collection of new settings to apply.
$(selector).linkedSliders('change', settings)jQuery object Update the settings for the linked instances attached to the given sliders.

settings (object) is the collection of new settings to apply.
$(selector).linkedSliders('change', name, value)jQuery object Update a single setting for the linked instances attached to the given sliders.

name (string) is the name of the setting;

value (any) is the setting value.
$(selector).linkedSliders('destroy')jQuery object Remove the linked sliders functionality from the given sliders.

Contact Keith Wood at kbwood{at}iinet.com.au with comments or suggestions.


Valid HTML 4.01 Strict