之前有写过自定义一个复选框的样式。
链接:http://blog.csdn.net/u014291497/article/details/52081774
又做了一个左右滑动开关效果的复选框。
效果图:
上图左侧为了显示数据变化所以显示出来,实际使用中设置display:none
属性就可以了。
本示例中全部使用HTML及CSS实现。
github地址:https://github.com/justforuse/HTML-CSS-JS/tree/master/customize-radio
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script></script>
<style>
.text {
display: none;
}
.on{
color:#333;
}
.off{
color:#eee;
}
.circle {