You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.4 KiB

9 years ago
  1. <html>
  2. <head>
  3. <meta name="viewport" content="width=device-width, initial-scale=1">
  4. <!--<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">-->
  5. <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>-->
  6. <link href="bootstrap-switch.css" rel="stylesheet">
  7. <script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
  8. <script src="bootstrap-switch.js"></script>
  9. <title>Bootstrap switch: test</title>
  10. </head>
  11. <body>
  12. <div class="container" style="height:40px;">
  13. <input type="checkbox" name="my-checkbox" checked>
  14. </div>
  15. <div class="container">
  16. <input type="checkbox" name="my-checkbox2" checked>
  17. </div>
  18. <script>
  19. /*var obj = $("[name='my-checkbox']");
  20. obj.bootstrapSwitch({
  21. state: false,
  22. readonly: false,
  23. size: 'small',
  24. /*onSwitchChange: function(event, state) {
  25. event.preventDefault();
  26. return console.log(state, event.isDefaultPrevented());
  27. }
  28. });
  29. obj.bootstrapSwitch('state', true, false);
  30. //obj.bootstrapSwitch('disabled', true);
  31. console.log(obj[0].checked);*/
  32. </script>
  33. </body>
  34. </html>