|
@@ -2,11 +2,12 @@
|
|
|
<html lang="en">
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
- <title>Bootstrap switch - by Mattia Larentis</title>
|
|
|
+ <title>Bootstrap switch - by Mattia Larentis, enhanced by BdMdesigN aka Peter Stein</title>
|
|
|
<meta name="author" content="Mattia Larentis">
|
|
|
+ <meta name="subauthor" content="Peter Stein">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;" />
|
|
|
|
|
|
- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
|
|
|
+ <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
|
|
|
<link rel="stylesheet" href="../static/stylesheets/bootstrap-switch.css">
|
|
|
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.css">
|
|
|
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/docs.css">
|
|
@@ -312,6 +313,139 @@ $('#disable-switch').bootstrapSwitch('setActive', false); // true || false</pre
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
+<div class="row-fluid">
|
|
|
+ <div class="span12">
|
|
|
+ <h3>Radio <small>- radioboxes 1</small></h3>
|
|
|
+
|
|
|
+ <div class="bs-docs-example">
|
|
|
+ <div class="control-group exemple1">
|
|
|
+ <br /><br />
|
|
|
+ <div id="radio1" class="controls">
|
|
|
+ <label class="control-label" for="yes">Yes</label>
|
|
|
+ <div id="yes" class="switch radio1" data-on-label="Yes" data-off-label="No" data-on="success" data-off="danger">
|
|
|
+ <input type="radio" name="radio1" class="check demo-1" value="1" checked />
|
|
|
+ </div>
|
|
|
+ <label class="control-label" for="no">No</label>
|
|
|
+ <div id="no" class="switch radio1" data-on-label="Yes" data-off-label="No" data-on="success" data-off="danger">
|
|
|
+ <input type="radio" name="radio1" class="check demo-1" value="0" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="clearfix"></div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <pre class="prettyprint linenums">
|
|
|
+ <div class="control-group exemple1">
|
|
|
+ <br /><br />
|
|
|
+ <div id="radio1" class="controls">
|
|
|
+ <label class="control-label" for="yes">Yes</label>
|
|
|
+ <div id="yes" class="switch radio1" data-on-label="Yes" data-off-label="No" data-on="success" data-off="danger">
|
|
|
+ <input type="radio" name="radio1" class="check demo-1" value="1" checked />
|
|
|
+ </div>
|
|
|
+ <label class="control-label" for="no">No</label>
|
|
|
+ <div id="no" class="switch radio1" data-on-label="Yes" data-off-label="No" data-on="success" data-off="danger">
|
|
|
+ <input type="radio" name="radio1" class="check demo-1" value="0" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+<script>
|
|
|
+$(document).ready(function() {
|
|
|
+ $('.radio1').on('switch-change', function () {
|
|
|
+ $('.radio1').bootstrapSwitch('toggleRadioState');
|
|
|
+ });
|
|
|
+});
|
|
|
+</script></pre>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
+<div class="row-fluid">
|
|
|
+ <div class="span12">
|
|
|
+ <h3>Radio <small>- radioboxes 2</small></h3>
|
|
|
+
|
|
|
+ <div class="bs-docs-example">
|
|
|
+ <div id="exemple2" class="control-group exemple2">
|
|
|
+ <br /><br />
|
|
|
+ <div class="control-group" style="margin-bottom: 2%;">
|
|
|
+ <div style="width: 10%;float: left;">
|
|
|
+ <label class="control-label" for="option1">Option 1</label>
|
|
|
+ </div>
|
|
|
+ <div class="controls">
|
|
|
+ <div id="option1" class="switch radio2">
|
|
|
+ <input id="radio1" type="radio" name="radio2" value="option1" checked />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group" style="margin-bottom: 2%;">
|
|
|
+ <div style="width: 10%;float: left;">
|
|
|
+ <label class="control-label" for="option2">Option 2</label>
|
|
|
+ </div>
|
|
|
+ <div class="controls">
|
|
|
+ <div id="option2" class="switch radio2">
|
|
|
+ <input id="radio2" type="radio" name="radio2" value="option2" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group" style="margin-bottom: 2%;">
|
|
|
+ <div style="width: 10%;float: left;">
|
|
|
+ <label class="control-label" for="option3">Option 3</label>
|
|
|
+ </div>
|
|
|
+ <div class="controls">
|
|
|
+ <div id="option3" class="switch radio2">
|
|
|
+ <input id="radio3" type="radio" name="radio2" value="option3" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="clearfix"></div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <pre class="prettyprint linenums">
|
|
|
+ <div id="exemple2" class="control-group exemple2">
|
|
|
+ <br /><br />
|
|
|
+ <div class="control-group" style="margin-bottom: 2%;">
|
|
|
+ <div style="width: 10%;float: left;">
|
|
|
+ <label class="control-label" for="option1">Option 1</label>
|
|
|
+ </div>
|
|
|
+ <div class="controls radio2">
|
|
|
+ <div id="option1" class="switch option1">
|
|
|
+ <input id="radio1" type="radio" name="radio2" value="option1" checked />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group" style="margin-bottom: 2%;">
|
|
|
+ <div style="width: 10%;float: left;">
|
|
|
+ <label class="control-label" for="option2">Option 2</label>
|
|
|
+ </div>
|
|
|
+ <div class="controls radio2">
|
|
|
+ <div id="option2" class="switch option2">
|
|
|
+ <input id="radio2" type="radio" name="radio2" value="option2" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group" style="margin-bottom: 2%;">
|
|
|
+ <div style="width: 10%;float: left;">
|
|
|
+ <label class="control-label" for="option3">Option 3</label>
|
|
|
+ </div>
|
|
|
+ <div class="controls radio2">
|
|
|
+ <div id="option3" class="switch option3">
|
|
|
+ <input id="radio3" type="radio" name="radio2" value="option3" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+<script>
|
|
|
+$(document).ready(function() {
|
|
|
+ $('.radio2').on('switch-change', function () {
|
|
|
+ $('.radio2').bootstrapSwitch('toggleRadioGroupState');
|
|
|
+ });
|
|
|
+});
|
|
|
+</script></pre>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
<div class="row-fluid">
|
|
|
<div class="span12">
|
|
|
<h3>Form <small>- try to use tab, space and reset button</small></h3>
|
|
@@ -427,6 +561,7 @@ $('#disable-switch').bootstrapSwitch('setActive', false); // true || false</pre
|
|
|
<script src="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.js"></script>
|
|
|
<script src="../static/js/bootstrap-switch.js"></script>
|
|
|
<script>
|
|
|
+$(document).ready(function() {
|
|
|
window.prettyPrint && prettyPrint();
|
|
|
$('#mySwitch').on('switch-change', function (e, data) {
|
|
|
var $el = $(data.el)
|
|
@@ -475,6 +610,16 @@ $('#disable-switch').bootstrapSwitch('setActive', false); // true || false</pre
|
|
|
$('#btn-activate-switch').on('click', function () {
|
|
|
$('#disable-switch').bootstrapSwitch('setActive', true);
|
|
|
});
|
|
|
+
|
|
|
+ $('.radio1').on('switch-change', function () {
|
|
|
+ $('.radio1').bootstrapSwitch('toggleRadioState');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.radio2').on('switch-change', function () {
|
|
|
+ $('.radio2').bootstrapSwitch('toggleRadioState');
|
|
|
+ });
|
|
|
+
|
|
|
+});
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|