BootstrapPlugin - toggleButton 使用笔记
1) checkbox 转换为 开关的样式,很有趣。
留档备份
2) 官方文档 & 官方DEMO
[url]http://www.larentis.eu/bootstrap_toggle_buttons/[/url]
3) 截图
[img]http://dl.iteye.com/upload/picture/pic/121707/0936a74f-77bb-3831-a5f5-6d6c35a23f87.png[/img]
[img]http://dl.iteye.com/upload/picture/pic/121709/78117f97-c5a8-3036-a6e0-daa7ca7dced5.png[/img]
4) 代码
:)
1) checkbox 转换为 开关的样式,很有趣。
留档备份
2) 官方文档 & 官方DEMO
[url]http://www.larentis.eu/bootstrap_toggle_buttons/[/url]
3) 截图
[img]http://dl.iteye.com/upload/picture/pic/121707/0936a74f-77bb-3831-a5f5-6d6c35a23f87.png[/img]
[img]http://dl.iteye.com/upload/picture/pic/121709/78117f97-c5a8-3036-a6e0-daa7ca7dced5.png[/img]
4) 代码
<!DOCTYPE HTML>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bootstrap Base</title>
<link type="text/css" rel="stylesheet" href="css/bootstrap.css" />
<link type="text/css" rel="stylesheet" href="css/bootstrap-toggle-buttons.css" />
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap-toggleButtons.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("[rel='tooltip']").tooltip({placement: "right"});
$("#button1").toggleButtons({
onChange: function($el, status, e) {
$("#log").text("status = " + status);
},
label: {
enabled: "开启",
disabled: "关闭"
},
style: {
enabled: "info",
disabled: "danger"
},
animated: true,
transitionspeed: 0.10,
width: 100,
height: 50
});
});
</script>
</head>
<body>
<div id="log" style="border: 1px solid #000;">
</div>
<br/>
<div id="button1">
<input type="checkbox" checked="checked" />
</div>
</body>
</html>
:)