methods-3.jade 1.5 KB

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