我将switchery.js用于我的项目https://github.com/abpetkov/switchery
<head>
<link rel="stylesheet" href="css/switchery.css">
<script src="js/switchery.js"></script>
<script>
var Switchery = require('switchery');
var elems = Array.prototype.slice.call(document.querySelectorAll('.switchery'));
elems.forEach(function(html) {
var switchery = new Switchery(html);
});
</script>
<body>
<div id="wrapper">
...
<div id="screen-2"><input type="checkbox" class="switchery"></div>
...
</div>
</body>
但问题是,它看起来像标准复选框。 请帮忙!