index.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  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>indeterminate</td>
  168. <td>Boolean</td>
  169. <td>indeterminate state</td>
  170. <td>true, false</td>
  171. <td>false</td>
  172. </tr>
  173. <tr>
  174. <td>onColor</td>
  175. <td>String</td>
  176. <td>Color of the left side of the switch</td>
  177. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  178. <td>'primary'</td>
  179. </tr>
  180. <tr>
  181. <td>offColor</td>
  182. <td>String</td>
  183. <td>Color of the right side of the switch</td>
  184. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  185. <td>'default'</td>
  186. </tr>
  187. <tr>
  188. <td>onText</td>
  189. <td>String</td>
  190. <td>Text of the left side of the switch</td>
  191. <td>String</td>
  192. <td>'ON'</td>
  193. </tr>
  194. <tr>
  195. <td>offText</td>
  196. <td>String</td>
  197. <td>Text of the right side of the switch</td>
  198. <td>String</td>
  199. <td>'OFF'</td>
  200. </tr>
  201. <tr>
  202. <td>labelText</td>
  203. <td>String</td>
  204. <td>Text of the center handle of the switch</td>
  205. <td>String</td>
  206. <td>'&amp;nbsp;'</td>
  207. </tr>
  208. <tr>
  209. <td>baseClass</td>
  210. <td>String</td>
  211. <td>Global class prefix</td>
  212. <td>String</td>
  213. <td>'bootstrap-switch'</td>
  214. </tr>
  215. <tr>
  216. <td>wrapperClass</td>
  217. <td>String | Array</td>
  218. <td>Container element class(es)</td>
  219. <td>String | Array</td>
  220. <td>'wrapper'</td>
  221. </tr>
  222. <tr>
  223. <td>onInit</td>
  224. <td>Function</td>
  225. <td>Callback function to execute on initialization</td>
  226. <td>Function</td>
  227. <td>
  228. <pre><code class="javascript">function(event, state) {}</code></pre>
  229. </td>
  230. </tr>
  231. <tr>
  232. <td>onSwitchChange</td>
  233. <td>Function</td>
  234. <td>Callback function to execute on switch state change</td>
  235. <td>Function</td>
  236. <td>
  237. <pre><code class="javascript">function(event, state) {}</code></pre>
  238. </td>
  239. </tr>
  240. </tbody>
  241. </table>
  242. <h3>Global Defaults Overriding</h3>
  243. <p>Follow the jQuery convention to override the default options of the library. For instance:</p>
  244. <pre><code>$.fn.bootstrapSwitch.defaults.size = 'large';
  245. $.fn.bootstrapSwitch.defaults.onColor = 'success';</code></pre>
  246. </div>
  247. <div id="methods-3">
  248. <h2 class="page-header">Methods</h2>
  249. <p>In Bootstrap Switch, every option is also a method.</p>
  250. <p>If the second parameter is omitted, the method return the current value.</p>
  251. <p>You can invoke methods as follows:</p>
  252. <pre><code>$('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);</code></pre>
  253. <h3>Additional Methods</h3>
  254. <table class="table table-bordered table-striped table-responsive">
  255. <thead>
  256. <tr>
  257. <th>Name</th>
  258. <th>Description</th>
  259. </tr>
  260. </thead>
  261. <tbody>
  262. <tr>
  263. <td>toggleState</td>
  264. <td>Toggle the switch state</td>
  265. </tr>
  266. <tr>
  267. <td>toggleDisabled</td>
  268. <td>Toggle the disabled state</td>
  269. </tr>
  270. <tr>
  271. <td>toggleReadonly</td>
  272. <td>Toggle the readonly state</td>
  273. </tr>
  274. <tr>
  275. <td>destroy</td>
  276. <td>Destroy the instance of Bootstrap Switch</td>
  277. </tr>
  278. </tbody>
  279. </table>
  280. <h3>Special Behaviours</h3>
  281. <ul>
  282. <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>
  283. <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>
  284. <li>The method <code>wrapperClass</code> can accepts a falsy value as second parameter. If so, it resets the class to its default.</li>
  285. </ul>
  286. </div>
  287. <div id="events-3">
  288. <h2 class="page-header">Events</h2>
  289. <p>
  290. All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
  291. attach your handlers.<br>
  292. You can register to the emitted events as follow:
  293. </p>
  294. <pre><code>$('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
  295. console.log(this); // DOM element
  296. console.log(event); // jQuery event
  297. console.log(state); // true | false
  298. });</code></pre>
  299. <table class="table table-bordered table-striped table-responsive">
  300. <thead>
  301. <tr>
  302. <th>Name</th>
  303. <th>Description</th>
  304. <th>Parameters</th>
  305. </tr>
  306. </thead>
  307. <tbody>
  308. <tr>
  309. <td>init</td>
  310. <td>Triggered on initialization. 'this' refers to the DOM element.</td>
  311. <td>event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)</td>
  312. </tr>
  313. <tr>
  314. <td>switchChange</td>
  315. <td>Triggered on switch state change. 'this' refers to the DOM element.</td>
  316. <td>
  317. event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
  318. state (true | false)
  319. </td>
  320. </tr>
  321. </tbody>
  322. </table>
  323. </div>
  324. <div id="examples-3">
  325. <h2 class="page-header">Examples</h2>
  326. <p>To be included</p>
  327. <!--
  328. h3 State
  329. .row
  330. .col-sm-6
  331. input(type='checkbox', id='state-switch' checked)
  332. .col-sm-6
  333. .btn-group.pull-right
  334. button(type='button', id='state-switch-state', class='btn btn-default') Get State
  335. &nbsp;
  336. button(type='button', id='state-switch-on', class='btn btn-default') Set On
  337. &nbsp;
  338. button(type='button', id='state-switch-off', class='btn btn-default') Set Off
  339. &nbsp;
  340. button(type='button', id='state-switch-toggle', class='btn btn-default') Toggle State
  341. -->
  342. </div>
  343. </div>
  344. <div id="documentation-2">
  345. <h1 class="page-header">Documentation <small>version 2.0.1 (Legacy)</small></h1>
  346. <div id="options-2">
  347. <h2 class="page-header">Options</h2>
  348. <div class="alert alert-warning">
  349. <p>
  350. All the options are accepted only using <code>data-*</code> attributes on the input element.<br>
  351. The exceptions are <code>checked</code>, <code>disabled</code> and <code>readonly</code> which are
  352. proprietary input attributes.<br>
  353. There isn't any way to specify the options in JavaScript during initialization.
  354. </p>
  355. </div>
  356. <table class="table table-bordered table-striped table-responsive">
  357. <thead>
  358. <tr>
  359. <th>Name</th>
  360. <th>Type</th>
  361. <th>Description</th>
  362. <th>Values</th>
  363. <th>Default</th>
  364. </tr>
  365. </thead>
  366. <tbody>
  367. <tr>
  368. <td>state</td>
  369. <td>Boolean</td>
  370. <td>The checkbox state</td>
  371. <td>true, false</td>
  372. <td>'checked' attribute or true</td>
  373. </tr>
  374. <tr>
  375. <td>size</td>
  376. <td>String</td>
  377. <td>The checkbox state</td>
  378. <td>'', 'mini', 'small', 'normal', 'large'</td>
  379. <td>''</td>
  380. </tr>
  381. <tr>
  382. <td>animate</td>
  383. <td>Boolean</td>
  384. <td>Animate the switch</td>
  385. <td>true, false</td>
  386. <td>true</td>
  387. </tr>
  388. <tr>
  389. <td>disabled</td>
  390. <td>Boolean</td>
  391. <td>Disable state</td>
  392. <td>true, false</td>
  393. <td>'disabled' attribute or false</td>
  394. </tr>
  395. <tr>
  396. <td>readonly</td>
  397. <td>Boolean</td>
  398. <td>Readonly state</td>
  399. <td>true, false</td>
  400. <td>'readonly' attribute or false</td>
  401. </tr>
  402. <tr>
  403. <td>on</td>
  404. <td>String</td>
  405. <td>Color of the left side of the switch</td>
  406. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  407. <td>null</td>
  408. </tr>
  409. <tr>
  410. <td>off</td>
  411. <td>String</td>
  412. <td>Color of the right side of the switch</td>
  413. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  414. <td>null</td>
  415. </tr>
  416. <tr>
  417. <td>on-label</td>
  418. <td>String</td>
  419. <td>Text of the left side of the switch</td>
  420. <td>String</td>
  421. <td>'ON'</td>
  422. </tr>
  423. <tr>
  424. <td>off-label</td>
  425. <td>String</td>
  426. <td>Text of the right side of the switch</td>
  427. <td>String</td>
  428. <td>'OFF'</td>
  429. </tr>
  430. <tr>
  431. <td>text-label</td>
  432. <td>String</td>
  433. <td>Text of the center handle of the switch</td>
  434. <td>String</td>
  435. <td>'&amp;nbsp;'</td>
  436. </tr>
  437. <tr>
  438. <td>label-icon</td>
  439. <td>String</td>
  440. <td>Text of the center handle of the switch. Use to include external services icons</td>
  441. <td>String</td>
  442. <td>null</td>
  443. </tr>
  444. </tbody>
  445. </table>
  446. </div>
  447. <div id="methods-2">
  448. <h2 class="page-header">Methods</h2>
  449. <table class="table table-bordered table-striped table-responsive">
  450. <thead>
  451. <tr>
  452. <th>Name</th>
  453. <th>Description</th>
  454. <th>Accepted Values</th>
  455. <th>Returned Values</th>
  456. </tr>
  457. </thead>
  458. <tbody>
  459. <tr>
  460. <td>state</td>
  461. <td>Get checkbox state</td>
  462. <td></td>
  463. <td>true, false</td>
  464. </tr>
  465. <tr>
  466. <td>setState</td>
  467. <td>Set checkbox state</td>
  468. <td>(value: true, false)[, skip: true, <strong>false</strong>]</td>
  469. <td>jQuery Object (input element)</td>
  470. </tr>
  471. <tr>
  472. <td>toggleState</td>
  473. <td>Toggle checkbox state</td>
  474. <td>[skip: true, <strong>false</strong>]</td>
  475. <td>jQuery Object (input element)</td>
  476. </tr>
  477. <tr>
  478. <td>toggleRadioState</td>
  479. <td>Toggle radio state</td>
  480. <td>[skip: true, <strong>false</strong>]</td>
  481. <td>jQuery Object (input element)</td>
  482. </tr>
  483. <tr>
  484. <td>toggleRadioStateAllowUncheck</td>
  485. <td>Toggle radio state allowing uncheck of the radio input</td>
  486. <td>[uncheck: true, <strong>false</strong> | skip: true, <strong>false</strong>]</td>
  487. <td>jQuery Object (input element)</td>
  488. </tr>
  489. <tr>
  490. <td>setSizeClass</td>
  491. <td>Set the size of the switch</td>
  492. <td>'', 'mini', 'small', 'normal', 'large'</td>
  493. <td>jQuery Object (input element)</td>
  494. </tr>
  495. <tr>
  496. <td>setAnimated</td>
  497. <td>Animate the switch</td>
  498. <td>true, false</td>
  499. <td>jQuery Object (input element)</td>
  500. </tr>
  501. <tr>
  502. <td>isDisabled</td>
  503. <td>Get disabled state</td>
  504. <td></td>
  505. <td>true, false</td>
  506. </tr>
  507. <tr>
  508. <td>setDisabled</td>
  509. <td>Set disable state</td>
  510. <td>true, false</td>
  511. <td>jQuery Object (input element)</td>
  512. </tr>
  513. <tr>
  514. <td>toggleDisabled</td>
  515. <td>Toggle disabled state</td>
  516. <td></td>
  517. <td>jQuery Object (input element)</td>
  518. </tr>
  519. <tr>
  520. <td>isReadOnly</td>
  521. <td>Get Readonly state</td>
  522. <td></td>
  523. <td>true, false</td>
  524. </tr>
  525. <tr>
  526. <td>setReadOnly</td>
  527. <td>Set Readonly state</td>
  528. <td>true, false</td>
  529. <td>jQuery Object (input element)</td>
  530. </tr>
  531. <tr>
  532. <td>toggleReadOnly</td>
  533. <td>Toggle readonly state</td>
  534. <td></td>
  535. <td>jQuery Object (input element)</td>
  536. </tr>
  537. <tr>
  538. <td>setOnClass</td>
  539. <td>Color of the left side of the switch</td>
  540. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  541. <td>jQuery Object (input element)</td>
  542. </tr>
  543. <tr>
  544. <td>setOffClass</td>
  545. <td>Color of the right side of the switch</td>
  546. <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
  547. <td>jQuery Object (input element)</td>
  548. </tr>
  549. <tr>
  550. <td>setOnLabel</td>
  551. <td>Text of the left side of the switch</td>
  552. <td>String</td>
  553. <td>jQuery Object (input element)</td>
  554. </tr>
  555. <tr>
  556. <td>setOffLabel</td>
  557. <td>Text of the right side of the switch</td>
  558. <td>String</td>
  559. <td>jQuery Object (input element)</td>
  560. </tr>
  561. <tr>
  562. <td>setTextLabel</td>
  563. <td>Text of the center handle of the switch</td>
  564. <td>String</td>
  565. <td>null</td>
  566. </tr>
  567. <tr>
  568. <td>setTextIcon</td>
  569. <td>Text of the center handle of the switch. Use to include external services icons</td>
  570. <td>String</td>
  571. <td>null</td>
  572. </tr>
  573. <tr>
  574. <td>destroy</td>
  575. <td>Destroy the instance of Bootstrap Switch</td>
  576. <td></td>
  577. <td>jQuery Object (input element)</td>
  578. </tr>
  579. </tbody>
  580. </table>
  581. </div>
  582. <div id="events-2">
  583. <h2 class="page-header">Events</h2>
  584. <p>
  585. The only event triggered it <code>switch-change</code>. It returns two parameters: <code>event</code> and
  586. <code>data</code>.<br>
  587. The latter is an object that include <code>el</code> (the input DOM element) and <code>value</code> (the
  588. new input state)
  589. </p>
  590. </div>
  591. </div>
  592. </div>
  593. <script src="docs/lib/js/jquery.min.js"></script>
  594. <script src="docs/lib/js/bootstrap.min.js"></script>
  595. <script src="docs/lib/js/highlight.js"></script>
  596. <script src="dist/js/bootstrap-switch.js"></script>
  597. <script src="docs/index.js"></script>
  598. </body>
  599. </html>