Browse Source

add .bootstrapSwitch('status') example

Mattia Larentis 12 years ago
parent
commit
d799108e05
1 changed files with 6 additions and 0 deletions
  1. 6 0
      examples/index.html

+ 6 - 0
examples/index.html

@@ -234,11 +234,13 @@ $('#mySwitch').on('switch-change', function (e, data) {
             </div>
             <br>
             <br>
+            <div id="toggle-state-switch-button-status" class="btn btn-primary">Status!</div>
             <div id="toggle-state-switch-button-on" class="btn btn-primary">ON!</div>
             <div id="toggle-state-switch-button" class="btn btn-primary">Toggle me!</div>
             <div id="toggle-state-switch-button-off" class="btn btn-primary">OFF!</div>
         </div>
         <pre class="prettyprint linenums">
+$('#toggle-state-switch').bootstrapSwitch('status'); // true || false
 $('#toggle-state-switch').bootstrapSwitch('toggleState');
 $('#toggle-state-switch').bootstrapSwitch('setState', false); // true || false</pre>
     </div>
@@ -433,6 +435,10 @@ $('#disable-switch').bootstrapSwitch('setActive', false);  // true || false</pre
         $('#toggle-state-switch').bootstrapSwitch('setState', true);
     });
 
+    $('#toggle-state-switch-button-status').on('click', function () {
+        alert($('#toggle-state-switch').bootstrapSwitch('status'));
+    });
+
     $('#toggle-state-switch-button-off').on('click', function () {
         $('#toggle-state-switch').bootstrapSwitch('setState', false);
     });