求解
input[type=checkbox]{
-webkit-appearance:none;
border: none;
border-radius: 0px;
}
.map{
height: 20px;
width: 20px;
background: #fff url(../checked.png);
}
.nomap{
height: 20px;
width: 20px;
background: #fff url(../nocheck.png);
}
点击后监听改变事件,交叉着换class就完了
$(this).attr("class",nomap"")//没选中
$(this).attr("class",map"")//选中
$('.map').append("<style>.map:after{"+
"width: 100%;"+
"height: 100%;"+
"content: " ";"+
"background-color:red;"+
"color: yellow;"+
"display: inline-block;"+
"visibility: visible;"+
"border-radius: 3px;"+
"border:1px solid red;"+
"}</style>");
$('.map').append("<style>.map:checked:after{"+
"content: "\2713";/*UNICODE中对号*/"+
"font-size: 10px;"+
"font-weight:bold;"+
"}</style>");
你这里的选择器改成把name用单引号引起来?