Class: Field {#Field}

Extends

Implements

Field Method: constructor {#Field:constructor}

Syntax:

var myField = new Field(field, knob, [options]);

Arguments:

  1. field (mixed) - The element which will act as the field or the id as a string.
  2. knob (mixed) - The element which will act as the knob or the id as a string.
  3. options (object, optional) - An object with class options, see below.

Options:

Events:

Field Method: set {#Field:set}

Sets the step of the field. The values can't accede the 'max' and 'min' options.

Arguments:

  1. steps (object) An object with 'x' and 'y' for the new position of the knob.

Field Method: get {#Field:get}

Returns the current step of the field.

Returns:

  1. steps (object) An object with 'x' and 'y' for the position of the knob.

Field Method: setRanges {#Field:setRanges}

Changes the range of the field.

Arguments:

  1. ranges (object) An object with 'x' and 'y' for the ranges. Uses the same format as the options 'x' and 'y'.

Field Method: attach {#Field:attach}

Attaches the mouse listeners making the field draggable (and clickable)

Returns:

  1. (object) The field instance.

Field Method: detach {#Field:detach}

Detaches the mouse listeners making the field not draggable (and clickable)

Returns:

  1. (object) The field instance.