index.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
  8. <meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
  9. <title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
  10. <link href="http://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
  11. <link href="docs/lib/css/bootstrap.min.css" rel="stylesheet">
  12. <link href="docs/lib/css/highlight.css" rel="stylesheet">
  13. <link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
  14. <link href="docs/index.css" rel="stylesheet">
  15. <script>
  16. var _gaq = _gaq || [];
  17. _gaq.push(['_setAccount', 'UA-43092768-1']);
  18. _gaq.push(['_trackPageview']);
  19. (function () {
  20. var ga = document.createElement('script');
  21. ga.type = 'text/javascript';
  22. ga.async = true;
  23. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  24. var s = document.getElementsByTagName('script')[0];
  25. s.parentNode.insertBefore(ga, s);
  26. })();
  27. </script>
  28. </head>
  29. <body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
  30. <header role="banner" class="navbar navbar-default navbar-fixed-top top">
  31. <div class="container">
  32. <div class="navbar-header">
  33. <button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch <strong>3</strong></a>
  34. </div>
  35. <nav id="collapse" role="navigation" class="collapse navbar-collapse">
  36. <ul class="nav navbar-nav">
  37. <li class="dropdown"><a href="#" data-toggle="dropdown">Download<span class="caret"></span></a>
  38. <ul class="dropdown-menu">
  39. <li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip">3 (Stable)</a></li>
  40. <li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/v2.0.1.zip">2.0.1 (Legacy)</a></li>
  41. </ul>
  42. </li>
  43. <li><a href="#new">What's new</a></li>
  44. <li><a href="#start">Start</a></li>
  45. <li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
  46. <ul class="dropdown-menu">
  47. <li class="dropdown-header">Version 3 (Stable)</li>
  48. <li><a href="#options-3">Options</a></li>
  49. <li><a href="#methods-3">Methods</a></li>
  50. <li><a href="#events-3">Events</a></li>
  51. <li class="divider"></li>
  52. <li class="dropdown-header">Version 2.0.1 (Legacy)</li>
  53. <li><a href="#options-2">Options</a></li>
  54. <li><a href="#methods-2">Methods</a></li>
  55. <li><a href="#events-2">Events</a></li>
  56. </ul>
  57. </li>
  58. <li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
  59. </ul>
  60. </nav>
  61. </div>
  62. </header>
  63. <div class="container">
  64. <div class="header">
  65. <h2 class="title">Bootstrap Switch <strong>3</strong> <span class="old-version">2.0.1</span></h2>
  66. <p class="lead">Turn checkboxes and radio buttons in toggle switches.</p>
  67. <p>Select the version to download:</p>
  68. <p>
  69. <input type="checkbox" name="download-version" checked data-size="large" data-on-text="3" data-off-text="2.0.1">
  70. </p>
  71. <p><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" id="download-3" class="btn btn-lg btn-primary">Download 3</a><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/v2.0.1.zip" id="download-2" class="btn btn-lg btn-primary">Download 2.0.1</a></p><br><br>
  72. <iframe src="http://ghbtns.com/github-btn.html?user=nostalgiaz&amp;repo=bootstrap-switch&amp;type=watch&amp;count=true&amp;size=large" allowtransparency="true" frameborder="0" scrolling="0" width="184" height="30"></iframe>
  73. <iframe src="http://ghbtns.com/github-btn.html?user=nostalgiaz&amp;repo=bootstrap-switch&amp;type=fork&amp;count=true&amp;size=large" allowtransparency="true" frameborder="0" scrolling="0" width="144" height="30"></iframe><br><br><br>
  74. </div>
  75. <div class="alert alert-info">
  76. <p>
  77. <strong>Documentation in progress!</strong><br>
  78. It might not seem, but it's actually a lot of work. The goal is to make it as cleanest, most readable and
  79. understandable as possible.<br>
  80. If you feel there is something missing, submit a
  81. <a href="https://github.com/nostalgiaz/bootstrap-switch/pulls">pull request</a> with your changes. Every
  82. help is needed. Many thanks.
  83. </p>
  84. </div>
  85. <div id="new">
  86. <h1 class="page-header">What's new in version 3</h1>
  87. <ul>
  88. <li>API redesign for a more intuitive use</li>
  89. <li>Entire code source rewriting focused on cleanliness and performance</li>
  90. <li>Initialization options can be passed as JavaScript object or written as <code>data-*</code></li>
  91. <li>Plugin constructor publicly available from <code>$.fn.bootstrapSwitch.Constructor</code></li>
  92. <li>Plugin instance publicly available calling <code>.data('bootstrap-switch')</code></li>
  93. <li>Global overridable defaults options</li>
  94. <li>Improved flexibility with <code>baseClass</code> and <code>wrapperClass</code> options</li>
  95. <li>New <code>onInit</code> event</li>
  96. <li>Event namespacing</li>
  97. <li>Full Bootstrap 3 support</li>
  98. <li>A lot of fixed bug, as usual</li>
  99. </ul>
  100. </div>
  101. <div id="start">
  102. <h1 class="page-header">Getting Started</h1>
  103. <p>Include the dependencies: jQuery, Bootstrap and Bootstrap Switch CSS + Javascript.</p>
  104. <pre><code>[...]
  105. &lt;link href="bootstrap.css" rel="stylesheet"&gt;
  106. &lt;link href="bootstrap-switch.css" rel="stylesheet"&gt;
  107. &lt;script src="jquery.js"&gt;&lt;/script&gt;
  108. &lt;script src="bootstrap-switch.js"&gt;&lt;/script&gt;
  109. [...]</code></pre>
  110. <p>Add your checkbox.</p>
  111. <pre><code>&lt;input type="checkbox" name="my-checkbox" checked&gt;</code></pre>
  112. <p>Initialize Bootstrap Switch.</p>
  113. <pre><code>$("[name='my-checkbox']").bootstrapSwitch();</code></pre>
  114. <p>Enjoy.</p>
  115. </div>
  116. <div id="documentation-3">
  117. <h1 class="page-header">Documentation <small>Version 3 (Stable)</small></h1>
  118. <div id="options-3">
  119. <h2 class="page-header">Options</h2>
  120. <table class="table table-bordered table-striped table-responsive">
  121. <thead>
  122. <tr>
  123. <th>Name</th>
  124. <th>Type</th>
  125. <th>Description</th>
  126. <th>Values</th>
  127. <th>Default</th>
  128. </tr>
  129. </thead>
  130. <tbody>
  131. <tr>
  132. <td>state</td>
  133. <td>Boolean</td>
  134. <td>The checkbox state</td>
  135. <td>true, false</td>
  136. <td>'checked' attribute or true</td>
  137. </tr>
  138. <tr>
  139. <td>size</td>
  140. <td>String</td>
  141. <td>The checkbox state</td>
  142. <td>null, 'mini', 'small', 'normal', 'large'</td>
  143. <td>null</td>
  144. </tr>
  145. <tr>
  146. <td>animate</td>
  147. <td>Boolean</td>
  148. <td>Animate the switch</td>
  149. <td>true, false</td>
  150. <td>true</td>
  151. </tr>
  152. <tr>
  153. <td>disabled</td>
  154. <td>Boolean</td>
  155. <td>Disable state</td>
  156. <td>true, false</td>
  157. <td>'disabled' attribute or false</td>
  158. </tr>
  159. <tr>
  160. <td>readonly</td>
  161. <td>Boolean</td>
  162. <td>Readonly state</td>
  163. <td>true, false</td>
  164. <td>'readonly' attribute or false</td>
  165. </tr>
  166. <tr>
  167. <td>onColor</td>
  168. <td>String</td>
  169. <td>Color of the left side of the switch</td>
  170. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  171. <td>'primary'</td>
  172. </tr>
  173. <tr>
  174. <td>offColor</td>
  175. <td>String</td>
  176. <td>Color of the right side of the switch</td>
  177. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  178. <td>'default'</td>
  179. </tr>
  180. <tr>
  181. <td>onText</td>
  182. <td>String</td>
  183. <td>Text of the left side of the switch</td>
  184. <td>String</td>
  185. <td>'ON'</td>
  186. </tr>
  187. <tr>
  188. <td>offText</td>
  189. <td>String</td>
  190. <td>Text of the right side of the switch</td>
  191. <td>String</td>
  192. <td>'OFF'</td>
  193. </tr>
  194. <tr>
  195. <td>labelText</td>
  196. <td>String</td>
  197. <td>Text of the center handle of the switch</td>
  198. <td>String</td>
  199. <td>'&amp;nbsp;'</td>
  200. </tr>
  201. <tr>
  202. <td>baseClass</td>
  203. <td>String</td>
  204. <td>Global class prefix</td>
  205. <td>String</td>
  206. <td>'bootstrap-switch'</td>
  207. </tr>
  208. <tr>
  209. <td>wrapperClass</td>
  210. <td>String | Array</td>
  211. <td>Container element class(es)</td>
  212. <td>String | Array</td>
  213. <td>'wrapper'</td>
  214. </tr>
  215. <tr>
  216. <td>onInit</td>
  217. <td>Function</td>
  218. <td>Callback function to execute on initialization</td>
  219. <td>Function</td>
  220. <td>
  221. <pre><code class="javascript">function(event, state) {}</code></pre>
  222. </td>
  223. </tr>
  224. <tr>
  225. <td>onSwitchChange</td>
  226. <td>Function</td>
  227. <td>Callback function to execute on switch state change</td>
  228. <td>Function</td>
  229. <td>
  230. <pre><code class="javascript">function(event, state) {}</code></pre>
  231. </td>
  232. </tr>
  233. </tbody>
  234. </table>
  235. <h3>Global Defaults Overriding</h3>
  236. <p>Follow the jQuery convention to override the default options of the library. For instance:</p>
  237. <pre><code>$.fn.bootstrapSwitch.defaults.size = 'large';
  238. $.fn.bootstrapSwitch.defaults.onColor = 'success';</code></pre>
  239. </div>
  240. <div id="methods-3">
  241. <h2 class="page-header">Methods</h2>
  242. <p>In Bootstrap Switch, every option is also a method.</p>
  243. <p>If the second parameter is omitted, the method return the current value.</p>
  244. <p>You can invoke methods as follows:</p>
  245. <pre><code>$('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);</code></pre>
  246. <h3>Additional Methods</h3>
  247. <table class="table table-bordered table-striped table-responsive">
  248. <thead>
  249. <tr>
  250. <th>Name</th>
  251. <th>Description</th>
  252. </tr>
  253. </thead>
  254. <tbody>
  255. <tr>
  256. <td>toggleState</td>
  257. <td>Toggle the switch state</td>
  258. </tr>
  259. <tr>
  260. <td>toggleDisabled</td>
  261. <td>Toggle the disabled state</td>
  262. </tr>
  263. <tr>
  264. <td>toggleReadonly</td>
  265. <td>Toggle the readonly state</td>
  266. </tr>
  267. <tr>
  268. <td>destroy</td>
  269. <td>Destroy the instance of Bootstrap Switch</td>
  270. </tr>
  271. </tbody>
  272. </table>
  273. <h3>Special Behaviours</h3>
  274. <ul>
  275. <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>
  276. <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>
  277. <li>The method <code>wrapperClass</code> can accepts a falsy value as second parameter. If so, it resets the class to its default.</li>
  278. </ul>
  279. </div>
  280. <div id="events-3">
  281. <h2 class="page-header">Events</h2>
  282. <p>
  283. All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
  284. attach your handlers.<br>
  285. You can register to the emitted events as follow:
  286. </p>
  287. <pre><code>$('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
  288. console.log(this); // DOM element
  289. console.log(event); // jQuery event
  290. console.log(state); // true | false
  291. });</code></pre>
  292. <table class="table table-bordered table-striped table-responsive">
  293. <thead>
  294. <tr>
  295. <th>Name</th>
  296. <th>Description</th>
  297. <th>Parameters</th>
  298. </tr>
  299. </thead>
  300. <tbody>
  301. <tr>
  302. <td>init</td>
  303. <td>Triggered on initialization. 'this' refers to the DOM element.</td>
  304. <td>event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)</td>
  305. </tr>
  306. <tr>
  307. <td>switchChange</td>
  308. <td>Triggered on switch state change. 'this' refers to the DOM element.</td>
  309. <td>
  310. event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
  311. state (true | false)
  312. </td>
  313. </tr>
  314. </tbody>
  315. </table>
  316. </div>
  317. <div id="examples-3">
  318. <h2 class="page-header">Examples</h2>
  319. <p>To be included</p>
  320. <!--
  321. h3 State
  322. .row
  323. .col-sm-6
  324. input(type='checkbox', id='state-switch' checked)
  325. .col-sm-6
  326. .btn-group.pull-right
  327. button(type='button', id='state-switch-state', class='btn btn-default') Get State
  328. &nbsp;
  329. button(type='button', id='state-switch-on', class='btn btn-default') Set On
  330. &nbsp;
  331. button(type='button', id='state-switch-off', class='btn btn-default') Set Off
  332. &nbsp;
  333. button(type='button', id='state-switch-toggle', class='btn btn-default') Toggle State
  334. -->
  335. </div>
  336. </div>
  337. <div id="documentation-2">
  338. <h1 class="page-header">Documentation <small>version 2.0.1 (Legacy)</small></h1>
  339. <div id="options-2">
  340. <h2 class="page-header">Options</h2>
  341. <div class="alert alert-warning">
  342. <p>
  343. All the options are accepted only using <code>data-*</code> attributes on the input element.<br>
  344. The exceptions are <code>checked</code>, <code>disabled</code> and <code>readonly</code> which are
  345. proprietary input attributes.<br>
  346. There isn't any way to specify the options in JavaScript during initialization.
  347. </p>
  348. </div>
  349. <table class="table table-bordered table-striped table-responsive">
  350. <thead>
  351. <tr>
  352. <th>Name</th>
  353. <th>Type</th>
  354. <th>Description</th>
  355. <th>Values</th>
  356. <th>Default</th>
  357. </tr>
  358. </thead>
  359. <tbody>
  360. <tr>
  361. <td>state</td>
  362. <td>Boolean</td>
  363. <td>The checkbox state</td>
  364. <td>true, false</td>
  365. <td>'checked' attribute or true</td>
  366. </tr>
  367. <tr>
  368. <td>size</td>
  369. <td>String</td>
  370. <td>The checkbox state</td>
  371. <td>'', 'mini', 'small', 'normal', 'large'</td>
  372. <td>''</td>
  373. </tr>
  374. <tr>
  375. <td>animate</td>
  376. <td>Boolean</td>
  377. <td>Animate the switch</td>
  378. <td>true, false</td>
  379. <td>true</td>
  380. </tr>
  381. <tr>
  382. <td>disabled</td>
  383. <td>Boolean</td>
  384. <td>Disable state</td>
  385. <td>true, false</td>
  386. <td>'disabled' attribute or false</td>
  387. </tr>
  388. <tr>
  389. <td>readonly</td>
  390. <td>Boolean</td>
  391. <td>Readonly state</td>
  392. <td>true, false</td>
  393. <td>'readonly' attribute or false</td>
  394. </tr>
  395. <tr>
  396. <td>on</td>
  397. <td>String</td>
  398. <td>Color of the left side of the switch</td>
  399. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  400. <td>null</td>
  401. </tr>
  402. <tr>
  403. <td>off</td>
  404. <td>String</td>
  405. <td>Color of the right side of the switch</td>
  406. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  407. <td>null</td>
  408. </tr>
  409. <tr>
  410. <td>on-label</td>
  411. <td>String</td>
  412. <td>Text of the left side of the switch</td>
  413. <td>String</td>
  414. <td>'ON'</td>
  415. </tr>
  416. <tr>
  417. <td>off-label</td>
  418. <td>String</td>
  419. <td>Text of the right side of the switch</td>
  420. <td>String</td>
  421. <td>'OFF'</td>
  422. </tr>
  423. <tr>
  424. <td>text-label</td>
  425. <td>String</td>
  426. <td>Text of the center handle of the switch</td>
  427. <td>String</td>
  428. <td>'&amp;nbsp;'</td>
  429. </tr>
  430. <tr>
  431. <td>label-icon</td>
  432. <td>String</td>
  433. <td>Text of the center handle of the switch. Use to include external services icons</td>
  434. <td>String</td>
  435. <td>null</td>
  436. </tr>
  437. </tbody>
  438. </table>
  439. </div>
  440. <div id="methods-2">
  441. <h2 class="page-header">Methods</h2>
  442. <table class="table table-bordered table-striped table-responsive">
  443. <thead>
  444. <tr>
  445. <th>Name</th>
  446. <th>Description</th>
  447. <th>Accepted Values</th>
  448. <th>Returned Values</th>
  449. </tr>
  450. </thead>
  451. <tbody>
  452. <tr>
  453. <td>state</td>
  454. <td>Get checkbox state</td>
  455. <td></td>
  456. <td>true, false</td>
  457. </tr>
  458. <tr>
  459. <td>setState</td>
  460. <td>Set checkbox state</td>
  461. <td>(value: true, false)[, skip: true, <strong>false</strong>]</td>
  462. <td>jQuery Object (input element)</td>
  463. </tr>
  464. <tr>
  465. <td>toggleState</td>
  466. <td>Toggle checkbox state</td>
  467. <td>[skip: true, <strong>false</strong>]</td>
  468. <td>jQuery Object (input element)</td>
  469. </tr>
  470. <tr>
  471. <td>toggleRadioState</td>
  472. <td>Toggle radio state</td>
  473. <td>[skip: true, <strong>false</strong>]</td>
  474. <td>jQuery Object (input element)</td>
  475. </tr>
  476. <tr>
  477. <td>toggleRadioStateAllowUncheck</td>
  478. <td>Toggle radio state allowing uncheck of the radio input</td>
  479. <td>[uncheck: true, <strong>false</strong> | skip: true, <strong>false</strong>]</td>
  480. <td>jQuery Object (input element)</td>
  481. </tr>
  482. <tr>
  483. <td>setSizeClass</td>
  484. <td>Set the size of the switch</td>
  485. <td>'', 'mini', 'small', 'normal', 'large'</td>
  486. <td>jQuery Object (input element)</td>
  487. </tr>
  488. <tr>
  489. <td>setAnimated</td>
  490. <td>Animate the switch</td>
  491. <td>true, false</td>
  492. <td>jQuery Object (input element)</td>
  493. </tr>
  494. <tr>
  495. <td>isDisabled</td>
  496. <td>Get disabled state</td>
  497. <td></td>
  498. <td>true, false</td>
  499. </tr>
  500. <tr>
  501. <td>setDisabled</td>
  502. <td>Set disable state</td>
  503. <td>true, false</td>
  504. <td>jQuery Object (input element)</td>
  505. </tr>
  506. <tr>
  507. <td>toggleDisabled</td>
  508. <td>Toggle disabled state</td>
  509. <td></td>
  510. <td>jQuery Object (input element)</td>
  511. </tr>
  512. <tr>
  513. <td>isReadOnly</td>
  514. <td>Get Readonly state</td>
  515. <td></td>
  516. <td>true, false</td>
  517. </tr>
  518. <tr>
  519. <td>setReadOnly</td>
  520. <td>Set Readonly state</td>
  521. <td>true, false</td>
  522. <td>jQuery Object (input element)</td>
  523. </tr>
  524. <tr>
  525. <td>toggleReadOnly</td>
  526. <td>Toggle readonly state</td>
  527. <td></td>
  528. <td>jQuery Object (input element)</td>
  529. </tr>
  530. <tr>
  531. <td>setOnClass</td>
  532. <td>Color of the left side of the switch</td>
  533. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  534. <td>jQuery Object (input element)</td>
  535. </tr>
  536. <tr>
  537. <td>setOffClass</td>
  538. <td>Color of the right side of the switch</td>
  539. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  540. <td>jQuery Object (input element)</td>
  541. </tr>
  542. <tr>
  543. <td>setOnLabel</td>
  544. <td>Text of the left side of the switch</td>
  545. <td>String</td>
  546. <td>jQuery Object (input element)</td>
  547. </tr>
  548. <tr>
  549. <td>setOffLabel</td>
  550. <td>Text of the right side of the switch</td>
  551. <td>String</td>
  552. <td>jQuery Object (input element)</td>
  553. </tr>
  554. <tr>
  555. <td>setTextLabel</td>
  556. <td>Text of the center handle of the switch</td>
  557. <td>String</td>
  558. <td>null</td>
  559. </tr>
  560. <tr>
  561. <td>setTextIcon</td>
  562. <td>Text of the center handle of the switch. Use to include external services icons</td>
  563. <td>String</td>
  564. <td>null</td>
  565. </tr>
  566. <tr>
  567. <td>destroy</td>
  568. <td>Destroy the instance of Bootstrap Switch</td>
  569. <td></td>
  570. <td>jQuery Object (input element)</td>
  571. </tr>
  572. </tbody>
  573. </table>
  574. </div>
  575. <div id="events-2">
  576. <h2 class="page-header">Events</h2>
  577. <p>
  578. The only event triggered it <code>switch-change</code>. It returns two parameters: <code>event</code> and
  579. <code>data</code>.<br>
  580. The latter is an object that include <code>el</code> (the input DOM element) and <code>value</code> (the
  581. new input state)
  582. </p>
  583. </div>
  584. </div>
  585. </div>
  586. <script src="docs/lib/js/jquery.min.js"></script>
  587. <script src="docs/lib/js/bootstrap.min.js"></script>
  588. <script src="docs/lib/js/highlight.js"></script>
  589. <script src="dist/js/bootstrap-switch.js"></script>
  590. <script src="docs/index.js"></script>
  591. </body>
  592. </html>