CSS3样式控制input按钮效果

.clearfix:before,
.clearfix:after {
  display: table;
  content: " ";
}

.clearfix:after {
  clear: both;
}
/* 多选框 */
/* example:<label><input type="checkbox" class="switch" id="" name=""><span></span> 同意</label> */
input[type="checkbox"].switch{position: absolute; opacity: 0;-moz-opacity: 0;-webkit-opacity: 0;filter:alpha(opacity=0);width: 20px;height: 20px;margin: 0;margin-left: 0 !important;cursor: pointer;}
input[type="checkbox"].switch+span{background: url(../img/sprites.png) no-repeat -155px 0px;vertical-align: top;display: inline-block; width: 20px; height: 20px;}
input[type="checkbox"].switch:checked+span{background: url(../img/sprites.png) no-repeat -105px 0px;}
input[type="checkbox"].switch:disabled+span{background: url(../img/sprites.png) no-repeat -180px 0px;}
input[type="checkbox"].switch:disabled:checked+span{background: url(../img/sprites.png) no-repeat -130px 0px;}
.checkbox-normal{background: url(../img/sprites.png) no-repeat -155px 0px !important;}
.checkbox-checked{background: url(../img/sprites.png) no-repeat -105px 0px !important;}
.checkbox-disabled{background: url(../img/sprites.png) no-repeat -180px 0px !important;}
.checkbox-checked-disabled{background: url(../img/sprites.png) no-repeat -130px 0px !important;}
/* 单选框 */
/* example:<label><input type="radio" class="switch" id="" name=""><span></span> 男</label> */
/* 单选取消:
var tempradio= null;
$("input[type='radio']").click(function(){
    if(tempradio==this){
        $(this).prop('checked',false);
        if ($.browser.msie && $.browser.version <= 9) {
        	$(this).next("span").attr('class', '');
        }
        tempradio=null;
    }else{
        $(this).prop('checked',true);
        if ($.browser.msie && $.browser.version <= 9) {
        	$(this).next("span").addClass("radio-checked");
        }
        tempradio=this;
    }
}) */
input[type="radio"].switch{position: absolute; opacity: 0;-moz-opacity: 0;-webkit-opacity: 0;filter:alpha(opacity=0);width: 20px;height: 20px;margin: 0;margin-left: 0 !important;cursor: pointer;}
input[type="radio"].switch+span{background: url(../img/sprites.png) no-repeat -155px -25px;vertical-align: top;display: inline-block; width: 20px; height: 20px;}
input[type="radio"].switch:checked+span{background: url(../img/sprites.png) no-repeat -105px -25px;}
input[type="radio"].switch:disabled+span{background: url(../img/sprites.png) no-repeat -180px -25px;}
input[type="radio"].switch:disabled:checked+span{background: url(../img/sprites.png) no-repeat -130px -25px;}
.radio-normal{background: url(../img/sprites.png) no-repeat -155px 25px !important;}
.radio-checked{background: url(../img/sprites.png) no-repeat -105px -25px !important;}
.radio-disabled{background: url(../img/sprites.png) no-repeat -180px -25px !important;}
.radio-checked-disabled{background: url(../img/sprites.png) no-repeat -130px -25px !important;}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云飞扬扬

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值