标签:
1)引入javascript
<link href="/static/switch/bootstrap-switch.css" rel="Stylesheet" type="text/css" /> <script src="/static/switch/bootstrap-switch.js"></script> <script type="text/javascript"> $$(function() { $$(‘[type="checkbox"]‘).bootstrapSwitch(); $$(‘[type="checkbox"]‘).on(‘switchChange.bootstrapSwitch‘, function (e, data) { var el = $$(data.el) , value = data.value; console.log(e, el, value); console.log(this.value) }); }); </script>
2)HTML
<input type="checkbox" class=‘mySwitch‘ $if item.IsEnabled: checked />
标签:
原文地址:http://my.oschina.net/u/2351685/blog/510080