methods.pug 1.6 KB

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