Skip to content

Commit 9e20fc6

Browse files
committed
updated readme with usage
1 parent 65f598d commit 9e20fc6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.markdown

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@ jQuery UI dial control
33

44
This is a dial widget for jQuery UI.
55

6+
Usage
7+
-----
8+
9+
Turning an existing DOM element into a dial widget is pretty easy:
10+
11+
$("#something").dial();
12+
13+
You can pass in any additional options and event handlers as arguments to the `dial` function, just like regular jQuery UI widgets. Example:
14+
15+
$("#something").dial({
16+
min: 0,
17+
max: 11,
18+
default: 5,
19+
20+
change: function(event, ui) {
21+
$("#somethingelse").html("Current value: "+ui.value);
22+
}
23+
});
24+
25+
The dial widget uses CSS background sprites for the rotating animation. Therefore a bit of extra CSS is necessary to ensure the dial will look like it should:
26+
27+
.ui-dial {
28+
display: inline-block;
29+
background: url('dial.png') no-repeat top left;
30+
width: 32px;
31+
height: 32px;
32+
}
33+
34+
See the demo directory in the repository for a complete example.
35+
636
Options
737
-------
838

0 commit comments

Comments
 (0)