|
@@ -8,10 +8,10 @@
|
|
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
|
|
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
|
|
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
|
|
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
|
|
<link href="http://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
|
|
<link href="http://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
|
|
- <link href="docs/lib/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
- <link href="docs/lib/css/highlight.css" rel="stylesheet">
|
|
|
|
|
|
+ <link href="docs/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
+ <link href="docs/css/highlight.css" rel="stylesheet">
|
|
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
|
|
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
|
|
- <link href="docs/index.css" rel="stylesheet">
|
|
|
|
|
|
+ <link href="docs/css/main.css" rel="stylesheet">
|
|
<script>
|
|
<script>
|
|
var _gaq = _gaq || [];
|
|
var _gaq = _gaq || [];
|
|
_gaq.push(['_setAccount', 'UA-43092768-1']);
|
|
_gaq.push(['_setAccount', 'UA-43092768-1']);
|
|
@@ -44,15 +44,8 @@
|
|
<li><a href="#start">Start</a></li>
|
|
<li><a href="#start">Start</a></li>
|
|
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
|
|
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
|
|
<ul class="dropdown-menu">
|
|
<ul class="dropdown-menu">
|
|
- <li class="dropdown-header">Version 3 (Stable)</li>
|
|
|
|
- <li><a href="#options-3">Options</a></li>
|
|
|
|
- <li><a href="#methods-3">Methods</a></li>
|
|
|
|
- <li><a href="#events-3">Events</a></li>
|
|
|
|
- <li class="divider"></li>
|
|
|
|
- <li class="dropdown-header">Version 2.0.1 (Legacy)</li>
|
|
|
|
- <li><a href="#options-2">Options</a></li>
|
|
|
|
- <li><a href="#methods-2">Methods</a></li>
|
|
|
|
- <li><a href="#events-2">Events</a></li>
|
|
|
|
|
|
+ <li><a href="/documentation-3.html">Version 3 (Stable)</a></li>
|
|
|
|
+ <li><a href="/documentation-2.html">Version 2.0.1 (Legacy)</a></li>
|
|
</ul>
|
|
</ul>
|
|
</li>
|
|
</li>
|
|
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
|
|
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
|
|
@@ -60,7 +53,7 @@
|
|
</nav>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
</header>
|
|
- <div class="container">
|
|
|
|
|
|
+ <div class="container content">
|
|
<div class="header">
|
|
<div class="header">
|
|
<h2 class="title">Bootstrap Switch <strong>3</strong> <span class="old-version">2.0.1</span></h2>
|
|
<h2 class="title">Bootstrap Switch <strong>3</strong> <span class="old-version">2.0.1</span></h2>
|
|
<p class="lead">Turn checkboxes and radio buttons in toggle switches.</p>
|
|
<p class="lead">Turn checkboxes and radio buttons in toggle switches.</p>
|
|
@@ -113,503 +106,21 @@
|
|
<pre><code>$("[name='my-checkbox']").bootstrapSwitch();</code></pre>
|
|
<pre><code>$("[name='my-checkbox']").bootstrapSwitch();</code></pre>
|
|
<p>Enjoy.</p>
|
|
<p>Enjoy.</p>
|
|
</div>
|
|
</div>
|
|
- <div id="documentation-3">
|
|
|
|
- <h1 class="page-header">Documentation <small>Version 3 (Stable)</small></h1>
|
|
|
|
- <div id="options-3">
|
|
|
|
- <h2 class="page-header">Options</h2>
|
|
|
|
- <table class="table table-bordered table-striped table-responsive">
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th>Name</th>
|
|
|
|
- <th>Attribute</th>
|
|
|
|
- <th>Type</th>
|
|
|
|
- <th>Description</th>
|
|
|
|
- <th>Values</th>
|
|
|
|
- <th>Default</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr>
|
|
|
|
- <td>state</td>
|
|
|
|
- <td>checked</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>The checkbox state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>true</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>size</td>
|
|
|
|
- <td>data-size</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>The checkbox state</td>
|
|
|
|
- <td>null, 'mini', 'small', 'normal', 'large'</td>
|
|
|
|
- <td>null</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>animate</td>
|
|
|
|
- <td>data-animate</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>Animate the switch</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>true</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>disabled</td>
|
|
|
|
- <td>disabled</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>Disable state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>readonly</td>
|
|
|
|
- <td>readonly</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>Readonly state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>indeterminate</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>indeterminate state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>onColor</td>
|
|
|
|
- <td>data-on-color</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Color of the left side of the switch</td>
|
|
|
|
- <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
|
|
|
|
- <td>'primary'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>offColor</td>
|
|
|
|
- <td>data-off-color</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Color of the right side of the switch</td>
|
|
|
|
- <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
|
|
|
|
- <td>'default'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>onText</td>
|
|
|
|
- <td>data-on-text</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Text of the left side of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>'ON'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>offText</td>
|
|
|
|
- <td>data-off-text</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Text of the right side of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>'OFF'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>labelText</td>
|
|
|
|
- <td>data-label-text</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Text of the center handle of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>'&nbsp;'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>baseClass</td>
|
|
|
|
- <td>data-base-class</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Global class prefix</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>'bootstrap-switch'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>wrapperClass</td>
|
|
|
|
- <td>data-wrapper-class</td>
|
|
|
|
- <td>String | Array</td>
|
|
|
|
- <td>Container element class(es)</td>
|
|
|
|
- <td>String | Array</td>
|
|
|
|
- <td>'wrapper'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>onInit</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>Function</td>
|
|
|
|
- <td>Callback function to execute on initialization</td>
|
|
|
|
- <td>Function</td>
|
|
|
|
- <td>
|
|
|
|
- <pre><code class="javascript">function(event, state) {}</code></pre>
|
|
|
|
- </td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>onSwitchChange</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>Function</td>
|
|
|
|
- <td>Callback function to execute on switch state change</td>
|
|
|
|
- <td>Function</td>
|
|
|
|
- <td>
|
|
|
|
- <pre><code class="javascript">function(event, state) {}</code></pre>
|
|
|
|
- </td>
|
|
|
|
- </tr>
|
|
|
|
- </tbody>
|
|
|
|
- </table>
|
|
|
|
- <h3>Global Defaults Overriding</h3>
|
|
|
|
- <p>Follow the jQuery convention to override the default options of the library. For instance:</p>
|
|
|
|
- <pre><code>$.fn.bootstrapSwitch.defaults.size = 'large';
|
|
|
|
-$.fn.bootstrapSwitch.defaults.onColor = 'success';</code></pre>
|
|
|
|
- </div>
|
|
|
|
- <div id="methods-3">
|
|
|
|
- <h2 class="page-header">Methods</h2>
|
|
|
|
- <p>In Bootstrap Switch, every option is also a method.</p>
|
|
|
|
- <p>If the second parameter is omitted, the method return the current value.</p>
|
|
|
|
- <p>You can invoke methods as follows:</p>
|
|
|
|
- <pre><code>$('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);</code></pre>
|
|
|
|
- <h3>Additional Methods</h3>
|
|
|
|
- <table class="table table-bordered table-striped table-responsive">
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th>Name</th>
|
|
|
|
- <th>Description</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleState</td>
|
|
|
|
- <td>Toggle the switch state</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleDisabled</td>
|
|
|
|
- <td>Toggle the disabled state</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleReadonly</td>
|
|
|
|
- <td>Toggle the readonly state</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>destroy</td>
|
|
|
|
- <td>Destroy the instance of Bootstrap Switch</td>
|
|
|
|
- </tr>
|
|
|
|
- </tbody>
|
|
|
|
- </table>
|
|
|
|
- <h3>Special Behaviours</h3>
|
|
|
|
- <ul>
|
|
|
|
- <li>The method <code>state</code> can receive an optional third parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.</li>
|
|
|
|
- <li>The method <code>toggleState</code> can receive an optional second parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.</li>
|
|
|
|
- <li>The method <code>wrapperClass</code> can accepts a falsy value as second parameter. If so, it resets the class to its default.</li>
|
|
|
|
- </ul>
|
|
|
|
- </div>
|
|
|
|
- <div id="events-3">
|
|
|
|
- <h2 class="page-header">Events</h2>
|
|
|
|
- <p>
|
|
|
|
- All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
|
|
|
|
- attach your handlers.<br>
|
|
|
|
- You can register to the emitted events as follow:
|
|
|
|
- </p>
|
|
|
|
- <pre><code>$('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
|
|
|
- console.log(this); // DOM element
|
|
|
|
- console.log(event); // jQuery event
|
|
|
|
- console.log(state); // true | false
|
|
|
|
-});</code></pre>
|
|
|
|
- <table class="table table-bordered table-striped table-responsive">
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th>Name</th>
|
|
|
|
- <th>Description</th>
|
|
|
|
- <th>Parameters</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr>
|
|
|
|
- <td>init</td>
|
|
|
|
- <td>Triggered on initialization. 'this' refers to the DOM element.</td>
|
|
|
|
- <td>event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>switchChange</td>
|
|
|
|
- <td>Triggered on switch state change. 'this' refers to the DOM element.</td>
|
|
|
|
- <td>
|
|
|
|
- event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
|
|
|
|
- state (true | false)
|
|
|
|
- </td>
|
|
|
|
- </tr>
|
|
|
|
- </tbody>
|
|
|
|
- </table>
|
|
|
|
- </div>
|
|
|
|
- <div id="examples-3">
|
|
|
|
- <h2 class="page-header">Examples</h2>
|
|
|
|
- <p>To be included</p>
|
|
|
|
- <!--
|
|
|
|
- h3 State
|
|
|
|
- .row
|
|
|
|
- .col-sm-6
|
|
|
|
- input(type='checkbox', id='state-switch' checked)
|
|
|
|
- .col-sm-6
|
|
|
|
- .btn-group.pull-right
|
|
|
|
- button(type='button', id='state-switch-state', class='btn btn-default') Get State
|
|
|
|
-
|
|
|
|
- button(type='button', id='state-switch-on', class='btn btn-default') Set On
|
|
|
|
-
|
|
|
|
- button(type='button', id='state-switch-off', class='btn btn-default') Set Off
|
|
|
|
-
|
|
|
|
- button(type='button', id='state-switch-toggle', class='btn btn-default') Toggle State
|
|
|
|
-
|
|
|
|
- -->
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div id="documentation-2">
|
|
|
|
- <h1 class="page-header">Documentation <small>version 2.0.1 (Legacy)</small></h1>
|
|
|
|
- <div id="options-2">
|
|
|
|
- <h2 class="page-header">Options</h2>
|
|
|
|
- <div class="alert alert-warning">
|
|
|
|
- <p>
|
|
|
|
- All the options are accepted only using <code>data-*</code> attributes on the element.<br>
|
|
|
|
- <code>checked</code>, <code>disabled</code> and <code>readonly</code> are exception to the rule, being
|
|
|
|
- default HTML input attributes.<br>
|
|
|
|
- Therefore, there is not any way to specify the options in JavaScript during initialization.
|
|
|
|
- </p>
|
|
|
|
- </div>
|
|
|
|
- <table class="table table-bordered table-striped table-responsive">
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th>Name</th>
|
|
|
|
- <th>Type</th>
|
|
|
|
- <th>Description</th>
|
|
|
|
- <th>Values</th>
|
|
|
|
- <th>Default</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr>
|
|
|
|
- <td>state</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>The checkbox state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>'checked' attribute or true</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>size</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>The checkbox state</td>
|
|
|
|
- <td>'', 'mini', 'small', 'normal', 'large'</td>
|
|
|
|
- <td>''</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>animate</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>Animate the switch</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>true</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>disabled</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>Disable state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>'disabled' attribute or false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>readonly</td>
|
|
|
|
- <td>Boolean</td>
|
|
|
|
- <td>Readonly state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>'readonly' attribute or false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>on</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Color of the left side of the switch</td>
|
|
|
|
- <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
|
|
|
|
- <td>null</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>off</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Color of the right side of the switch</td>
|
|
|
|
- <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
|
|
|
|
- <td>null</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>on-label</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Text of the left side of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>'ON'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>off-label</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Text of the right side of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>'OFF'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>text-label</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Text of the center handle of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>'&nbsp;'</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>label-icon</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>Text of the center handle of the switch. Use to include external services icons</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>null</td>
|
|
|
|
- </tr>
|
|
|
|
- </tbody>
|
|
|
|
- </table>
|
|
|
|
- </div>
|
|
|
|
- <div id="methods-2">
|
|
|
|
- <h2 class="page-header">Methods</h2>
|
|
|
|
- <table class="table table-bordered table-striped table-responsive">
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th>Name</th>
|
|
|
|
- <th>Description</th>
|
|
|
|
- <th>Accepted Values</th>
|
|
|
|
- <th>Returned Values</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr>
|
|
|
|
- <td>state</td>
|
|
|
|
- <td>Get checkbox state</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setState</td>
|
|
|
|
- <td>Set checkbox state</td>
|
|
|
|
- <td>(value: true, false)[, skip: true, <strong>false</strong>]</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleState</td>
|
|
|
|
- <td>Toggle checkbox state</td>
|
|
|
|
- <td>[skip: true, <strong>false</strong>]</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleRadioState</td>
|
|
|
|
- <td>Toggle radio state</td>
|
|
|
|
- <td>[skip: true, <strong>false</strong>]</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleRadioStateAllowUncheck</td>
|
|
|
|
- <td>Toggle radio state allowing uncheck of the radio input</td>
|
|
|
|
- <td>[uncheck: true, <strong>false</strong> | skip: true, <strong>false</strong>]</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setSizeClass</td>
|
|
|
|
- <td>Set the size of the switch</td>
|
|
|
|
- <td>'', 'mini', 'small', 'normal', 'large'</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setAnimated</td>
|
|
|
|
- <td>Animate the switch</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>isDisabled</td>
|
|
|
|
- <td>Get disabled state</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setDisabled</td>
|
|
|
|
- <td>Set disable state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleDisabled</td>
|
|
|
|
- <td>Toggle disabled state</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>isReadOnly</td>
|
|
|
|
- <td>Get Readonly state</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setReadOnly</td>
|
|
|
|
- <td>Set Readonly state</td>
|
|
|
|
- <td>true, false</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>toggleReadOnly</td>
|
|
|
|
- <td>Toggle readonly state</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setOnClass</td>
|
|
|
|
- <td>Color of the left side of the switch</td>
|
|
|
|
- <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setOffClass</td>
|
|
|
|
- <td>Color of the right side of the switch</td>
|
|
|
|
- <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setOnLabel</td>
|
|
|
|
- <td>Text of the left side of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setOffLabel</td>
|
|
|
|
- <td>Text of the right side of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setTextLabel</td>
|
|
|
|
- <td>Text of the center handle of the switch</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>null</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>setTextIcon</td>
|
|
|
|
- <td>Text of the center handle of the switch. Use to include external services icons</td>
|
|
|
|
- <td>String</td>
|
|
|
|
- <td>null</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>destroy</td>
|
|
|
|
- <td>Destroy the instance of Bootstrap Switch</td>
|
|
|
|
- <td></td>
|
|
|
|
- <td>jQuery Object (input element)</td>
|
|
|
|
- </tr>
|
|
|
|
- </tbody>
|
|
|
|
- </table>
|
|
|
|
- </div>
|
|
|
|
- <div id="events-2">
|
|
|
|
- <h2 class="page-header">Events</h2>
|
|
|
|
- <p>
|
|
|
|
- The only event triggered it <code>switch-change</code>. It returns two parameters: <code>event</code> and
|
|
|
|
- <code>data</code>.<br>
|
|
|
|
- The latter is an object that include <code>el</code> (the input DOM element) and <code>value</code> (the
|
|
|
|
- new input state)
|
|
|
|
- </p>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
- <script src="docs/lib/js/jquery.min.js"></script>
|
|
|
|
- <script src="docs/lib/js/bootstrap.min.js"></script>
|
|
|
|
- <script src="docs/lib/js/highlight.js"></script>
|
|
|
|
|
|
+ <div class="container bottom">
|
|
|
|
+ <p>
|
|
|
|
+ Licensed under the
|
|
|
|
+ <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a>
|
|
|
|
+ · Created by
|
|
|
|
+ <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a>
|
|
|
|
+ · Mantained by
|
|
|
|
+ <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
|
|
+ <script src="docs/js/jquery.min.js"></script>
|
|
|
|
+ <script src="docs/js/bootstrap.min.js"></script>
|
|
|
|
+ <script src="docs/js/highlight.js"></script>
|
|
<script src="dist/js/bootstrap-switch.js"></script>
|
|
<script src="dist/js/bootstrap-switch.js"></script>
|
|
- <script src="docs/index.js"></script>
|
|
|
|
|
|
+ <script src="docs/js/main.js"></script>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|