index.jade 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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
  10. link(rel='stylesheet', href='http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css')
  11. link(rel='stylesheet', href='http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css')
  12. link(rel='stylesheet', href='build/css/bootstrap3/bootstrap-switch.css')
  13. link(rel='stylesheet', href='docs/highlight.css')
  14. link(rel='stylesheet', href='docs/index.css')
  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. body
  28. header.navbar.navbar-default.navbar-fixed-top.header(role='banner')
  29. .container
  30. .navbar-header
  31. button.navbar-toggle(type='button', data-toggle='collapse', data-target='#collapse')
  32. span.sr-only Toggle navigation
  33. span.icon-bar
  34. span.icon-bar
  35. span.icon-bar
  36. a.navbar-brand(href='../') Bootstrap Switch
  37. nav#collapse.collapse.navbar-collapse(role='navigation')
  38. ul.nav.navbar-nav
  39. li: a(href='https://github.com/nostalgiaz/bootstrap-switch/archive/3.0.zip') Download 3RC
  40. li: a(href='#getting-started') Getting Started
  41. li.dropdown
  42. a(href='#documentation', data-toggle='dropdown')
  43. | Documentation
  44. span.caret
  45. ul.dropdown-menu
  46. li: a(href='#options') Options
  47. li: a(href='#methods') Methods
  48. //-
  49. li: a(href='#size') Size
  50. li: a(href='#colors') Colors
  51. li: a(href='#animation') Animation
  52. li: a(href='#disabled') Disabled / Readonly
  53. li: a(href='#text') Text
  54. li: a(href='#label-text') Label Text
  55. li: a(href='#icon-label-text') Icon Label Text
  56. li: a(href='#event-handlers') Event Handlers
  57. li: a(href='#label-event-handler') Label Event Handlers
  58. li: a(href='#state') State
  59. li: a(href='#destroy') Destroy
  60. li: a(href='#disable') Disable / Readonly
  61. li: a(href='#radio') Radio
  62. li: a(href='#form') Form
  63. li: a(href='#modal') Modal
  64. li: a(href='#examples') Examples
  65. li: a(href='https://github.com/nostalgiaz/bootstrap-switch/issues') Bug reports
  66. .container
  67. h1#title Bootstrap Switch
  68. p.lead Turn checkboxes and radio buttons in toggle switches.
  69. a(href='https://github.com/nostalgiaz/bootstrap-switch/archive/3.0.zip', class='btn btn-lg btn-primary') Download Bootstrap Switch 3 Release Candidate
  70. #getting-started
  71. h1.page-header Getting Started
  72. p Include the dependencies: jQuery, Bootstrap and Bootstrap Switch CSS + Javascript.
  73. pre: code
  74. [...]
  75. <link href="bootstrap.css" rel="stylesheet">
  76. <link href="bootstrap-switch.css" rel="stylesheet">
  77. <script src="jquery.js"></script>
  78. <script src="bootstrap-switch.js"></script>
  79. [...]
  80. #options
  81. h1.page-header Options
  82. table.table.table-bordered.table-striped.table-responsive
  83. thead
  84. tr
  85. th Name
  86. th Type
  87. th Description
  88. th Values
  89. th Default
  90. tbody
  91. tr
  92. td state
  93. td Boolean
  94. td The checkbox state
  95. td true, false
  96. td 'checked' attribute or true
  97. tr
  98. td size
  99. td String | Null
  100. td The checkbox state
  101. td null, 'mini', 'small', 'large'
  102. td null
  103. tr
  104. td animate
  105. td Boolean
  106. td Animate the switch
  107. td true, false
  108. td true
  109. tr
  110. td disabled
  111. td Boolean
  112. td Disable state
  113. td true, false
  114. td 'disabled' attribute or false
  115. tr
  116. td readonly
  117. td Boolean
  118. td Readonly state
  119. td true, false
  120. td 'readonly' attribute or false
  121. tr
  122. td onColor
  123. td String
  124. td Color of the left side of the switch
  125. td 'primary', 'info', 'success', 'warning', 'danger', 'default'
  126. td 'primary'
  127. tr
  128. td offColor
  129. td String
  130. td Color of the right side of the switch
  131. td 'primary', 'info', 'success', 'warning', 'danger', 'default'
  132. td 'default'
  133. tr
  134. td onText
  135. td String
  136. td Text of the left side of the switch
  137. td String
  138. td 'ON'
  139. tr
  140. td offText
  141. td String
  142. td Text of the right side of the switch
  143. td String
  144. td 'OFF'
  145. tr
  146. td labelText
  147. td String
  148. td Text of the center handle of the switch
  149. td String
  150. td ' '
  151. tr
  152. td on
  153. td Object
  154. td(colspan='3') Callback functions collection
  155. tr
  156. td on.init
  157. td Function
  158. td Callback function to execute on initialization
  159. td Function
  160. td function() {}
  161. tr
  162. td on.switchChange
  163. td Function
  164. td Callback function to execute on switch state change
  165. td Function
  166. td function() {}
  167. #methods
  168. h1.page-header Methods
  169. p In Bootstrap Switch, every option is also a method.
  170. p You can call a method in this way:
  171. pre: code $('input[name="my-checkbox"]').bootstrapSwitch('state', true);
  172. h2 Additional Methods
  173. table.table.table-bordered.table-striped.table-responsive
  174. thead
  175. tr
  176. th Name
  177. th Description
  178. tbody
  179. tr
  180. td toggleState
  181. td Toggle the switch state
  182. tr
  183. td toggleDisabled
  184. td Toggle the disabled state
  185. tr
  186. td toggleReadonly
  187. td Toggle the readonly state
  188. tr
  189. td destroy
  190. td Destroy the instance of Bootstrap Switch
  191. #examples
  192. h1.page-header Examples
  193. .row
  194. .col-sm-6
  195. input(type='checkbox', id='toggle-state-switch' checked)
  196. .col-sm-6
  197. button(type='button', id='toggle-state-switch-button-state', class='btn btn-default') Get State
  198.  
  199. button(type='button', id='toggle-state-switch-button-on', class='btn btn-default') Set On
  200.  
  201. button(type='button', id='toggle-state-switch-button-off', class='btn btn-default') Set Off
  202.  
  203. button(type='button', id='toggle-state-switch-button', class='btn btn-default') Toggle State
  204. script(src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js')
  205. script(src='http://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js')
  206. script(src='build/js/bootstrap-switch.js')
  207. script(src='docs/highlight.js')
  208. script(src='docs/index.js')