Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 40 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,33 @@ jQuery Knob
Example
-------

<input type="text" value="75" class="dial">
```html
<input type="text" value="75" class="dial">

<script>
<script>
$(function() {
$(".dial").knob();
});
</script>
</script>
```

Options
-------

Options are provided as attributes 'data-option':

<input type="text" class="dial" data-min="-50" data-max="50">
```html
<input type="text" class="dial" data-min="-50" data-max="50">
```

... or in the "knob()" call :

$(".dial").knob({
'min':-50
,'max':50
});
```javascript
$(".dial").knob({
'min':-50,
'max':50
});
```

The following options are supported :

Expand Down Expand Up @@ -58,11 +64,13 @@ UI :
Hooks
-------

<script>
```html
<script>
$(".dial").knob({
'release' : function (v) { /*make something*/ }
});
</script>
'release' : function (v) { /*make something*/ }
});
</script>
```

* 'release' : executed on release

Expand Down Expand Up @@ -92,40 +100,44 @@ The scope (this) of each hook function is the current Knob instance (refer to th
Example
-------

<input type="text" value="75" class="dial">
```html
<input type="text" value="75" class="dial">

<script>
<script>
$(".dial").knob({
'change' : function (v) { console.log(v); }
});
</script>

'change' : function (v) { console.log(v); }
});
</script>
```

Dynamically configure
-------

<script>
$('.dial')
.trigger(
'configure',
{
```html
<script>
$('.dial').trigger(
'configure',
{
"min":10,
"max":40,
"fgColor":"#FF0000",
"skin":"tron",
"cursor":true
}
);
</script>
}
);
</script>
```

Set the value
-------

<script>
```html
<script>
$('.dial')
.val(27)
.trigger('change');
</script>
</script>
```

Supported browser
-------
Expand Down