这是我的代码-
<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();
});我想要在这个页面上给出一个基本按钮- 开关按钮
我做得很好。但我还是错过了一些东西。
在这里登记- 小提琴
发布于 2013-02-20 09:01:47
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>发布于 2013-02-20 05:52:04
类事项
您的类仍然是“切换按钮”,改为“切换”。
这是您最新的小提琴:http://jsfiddle.net/WvRZw/10/
<div id="normal-toggle-button" class="toggle-button"....更改为
<div id="normal-toggle-button" class="switch" ....css/javascript包括
您还需要包括引导javascript和css (参见参考资料部分)(也包括javascript和css:如何使引导按钮显示活动状态?)。
https://stackoverflow.com/questions/14973093
复制相似问题