Skip to content

Commit

Permalink
Pretty code with syntax hilightling in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
volpino committed Sep 23, 2012
1 parent 2e098a0 commit c3206e0
Showing 1 changed file with 49 additions and 48 deletions.
97 changes: 49 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,62 @@ Basic Usage
-----------

HTML

<div id="toggle-button">
<input id="checkbox1" type="checkbox" value="value1" checked="checked">
</div>

``` html
<div id="toggle-button">
<input id="checkbox1" type="checkbox" value="value1" checked="checked">
</div>
```

JS
``` javascript
$('#toggle-button').toggleButtons();
```

$('#toggle-button').toggleButtons();

Full Example
------------

HTML

<div id="toggle-button">
<input id="checkbox1" type="checkbox" value="value1" checked="checked">
</div>

``` html
<div id="toggle-button">
<input id="checkbox1" type="checkbox" value="value1" checked="checked">
</div>
```

JS
``` javascript
$('#toggle-button').toggleButtons({
onChange: function ($el, status, e) {
// $el = $('#toggle-button');
// status = [true, false], the value of the checkbox
// e = the event
console.log($el, status, e);
},
width: 100,
height: 25,
font: {
'font-size': '20px',
'font-style': 'italic'
},
animated: true,
transitionSpeed: 1, // Accepted values float or "percent" [ 1, 0.5, "150%" ]
label: {
enabled: "ON",
disabled: "OFF"
},
style: {
// Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
enabled: "primary",
disabled: "danger",
custom: {
enabled: "#FF00FF",
enabledGradient: "#D300D3",
enabledColor: "#FFFFFF",
disabled: "#FFAA00",
disabledGradient: "#DD9900",
disabledColor: "#333333"
}
}
});


$('#toggle-button').toggleButtons({
onChange: function ($el, status, e) {
// $el = $('#toggle-button');
// status = [true, false], the value of the checkbox
// e = the event
console.log($el, status, e);
},
width: 100,
height: 25,
font: {
'font-size': '20px',
'font-style': 'italic'
},
animated: true,
transitionSpeed: 1, // Accepted values float or "percent" [ 1, 0.5, "150%" ]
label: {
enabled: "ON",
disabled: "OFF"
},
style: {
// Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
enabled: "primary",
disabled: "danger",
custom: {
enabled: "#FF00FF",
enabledGradient: "#D300D3",
enabledColor: "#FFFFFF",
disabled: "#FFAA00",
disabledGradient: "#DD9900",
disabledColor: "#333333"
}
}
});

$('#toggle-button').toggleButtons('toggleActivation'); // to toggle the disabled status
$('#toggle-button').toggleButtons('toggleActivation'); // to toggle the disabled status
```

0 comments on commit c3206e0

Please sign in to comment.