这是我的代码-
<div id="normal-toggle-button" class="toggle-button" style="width: 100px; height: 25px;">
<div style="left: 0px; width: 150px;"><input type="checkbox" checked="checked"><span class="labelLeft" style="width: 50px; height: 25px; line-height: 25px;">ON</span><label for="" style="width: 50px; height: 25px;"></label><span class="labelRight" style="width: 50px; height: 25px; line-height: 25px;">OFF </span></div>
</div>
</div>
脚本-
$(document).ready(function() {
$('#normal-toggle-button').toggleButtons();
});
我想要一个在此页面上给出的基本按钮- Switch buttons
我做得很好。但我仍然错过了一些东西。
在这里签到- Fiddle
最佳答案
bootstrapSwitch最简单的使用
<link href="bootstrap-switch.css" rel="stylesheet">
<script src="jquery.js"></script>
<script src="bootstrap-switch.js"></script>
<input type="checkbox">
<script>
$('input:checkbox').bootstrapSwitch();
</script>
关于javascript - 开/关 : switch button bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14973093/