methods.jade 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .bs-docs-header
  2. .container
  3. h1 Methods
  4. .container
  5. p In Bootstrap Switch, every option is also a method.
  6. p If the second parameter is omitted, the method returns the current value.
  7. p You can invoke methods as follows:
  8. pre: code $('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);
  9. h2 Additional Methods
  10. table.table.table-bordered.table-striped.table-responsive
  11. thead
  12. tr
  13. th Name
  14. th Description
  15. tbody
  16. tr
  17. td toggleState
  18. td Toggle the switch state
  19. tr
  20. td toggleAnimate
  21. td Toggle the animate option
  22. tr
  23. td toggleDisabled
  24. td Toggle the disabled state
  25. tr
  26. td toggleReadonly
  27. td Toggle the readonly state
  28. tr
  29. td toggleIndeterminate
  30. td Toggle the indeterminate state
  31. tr
  32. td toggleInverse
  33. td Toggle the inverse option
  34. tr
  35. td destroy
  36. td Destroy the instance of Bootstrap Switch
  37. h2 Special Behaviours
  38. ul
  39. 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.
  40. 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.
  41. li The method <code>wrapperClass</code> can accept a falsy value as second parameter. If so, it resets the class to its default.