Skip to content

Commit 6458eba

Browse files
committed
More documentation
1 parent 904797a commit 6458eba

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

README.markdown

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
jQuery UI dial control
22
======================
33

4-
This is a dial widget for jQuery UI.
4+
This is a dial widget for jQuery UI. It is made to imitate the dial controls encountered in various audio processing applications.
5+
6+
The dial values are represented using an image map. Changing the value of the dial is done by dragging it in a vertical linear motion.
57

68
Usage
79
-----
@@ -15,7 +17,7 @@ You can pass in any additional options and event handlers as arguments to the `d
1517
$("#something").dial({
1618
min: 0,
1719
max: 11,
18-
default: 5,
20+
value: 5,
1921
2022
change: function(event, ui) {
2123
$("#somethingelse").html("Current value: "+ui.value);
@@ -36,48 +38,68 @@ See the demo directory in the repository for a complete example.
3638
Options
3739
-------
3840

39-
* `min`
41+
* `min` (Number)
4042
Minimum value.
4143
Default: -100
4244

43-
* `max`
45+
* `max` (Number)
4446
Maximum value.
4547
Default: 100
4648

47-
* `default`
49+
* `value` (Number)
4850
Initial value.
4951
Default: 25
5052

51-
* `unitsPerPixel`
53+
* `unitsPerPixel` (Number)
5254
Amount of units to change the value per pixel of mouse movement.
5355
Default: 1
5456

55-
* `numImages`
57+
* `numImages` (Number)
5658
Number of images in the image map.
5759
Default: TODO
5860

59-
* `imageWidth`
61+
* `imageWidth` (Number)
6062
Width of an individual dial state image.
6163
Default: TODO
6264

6365
Events
6466
------
6567

66-
* `start`
67-
* `change`
68-
* `stop`
68+
* `start(event, ui)`
69+
Triggered when the user started dragging the dial.
70+
The current value of the dial is returned as `ui.value`.
71+
72+
* `change(event, ui)`
73+
Triggered when the user changes the value of the dial.
74+
The new value of the dial is returned as `ui.value`.
75+
76+
* `stop(event, ui)`
77+
Triggered when the user stopped dragging the dial.
78+
The current value of the dial is returned as `ui.value`.
6979

7080
Methods
7181
-------
7282

73-
* `destroy`
74-
* `disable`
75-
* `enable`
76-
* `option` (individual)
77-
* `option` (hash)
78-
* `widget`
79-
* `value` (get)
80-
* `value` (set)
83+
* `.dial("destroy")`
84+
Destroys the dial and all data associated with it.
85+
86+
* `.dial("disable")`
87+
Disables the dial.
88+
89+
* `.dial("enable")`
90+
Enables the dial.
91+
92+
* `.dial("option", optionName, [value])`
93+
Get or set any dial option. If no option is specified, it will act as a getter.
94+
95+
* `.dial("option", options)`
96+
Set multiple dial options at once by providing an options object.
97+
98+
* `.dial("widget")`
99+
Returns the .ui-dial element.
100+
101+
* `.dial("value, [newValue])`
102+
Get or set the dial value. If no value is specified, it will act as a getter.
81103

82104
License
83105
-------

0 commit comments

Comments
 (0)