• 复选框全选


    复选框

    <p class="copy_td"><input type="checkbox" class="input_check" id="checkbox11"><label for="checkbox11"></label></p>

    p {position: relative;}

    p .input_check {position: absolute;visibility: hidden; }

    p .input_check+label {display: inline-block;position: absolute;top: -10px;background: url(../images/checkboxno.png) left center no-repeat;80px; height: 16px; background-size: 16px; visibility: visible;}
    p .input_check:checked+label:after {content: "";position: absolute;left: 0px;background: url(../images/checkboxyes.png) left center no-repeat;80px; height: 16px;line-height: 16px; background-size: 16px;}

    var th =$(".copy_th input.input_check");

    var td =$(".copy_td input.input_check");
    th.click(function(){
    if (th.is(":checked") == false) {
    td.prop("checked",false);
    } else {
    td.prop("checked",true);
    }
    })
    td.click(function(){
    var tdlength=$(".copy_td input.input_check[type='checkbox']").length;
    var tdchecked=$(".copy_td input.input_check[type='checkbox']:checked").length;
    if (tdchecked == tdlength) {
    th.prop("checked",true);
    } else {
    th.prop("checked",false);
    }
    })

    单选框样式

    <i><input type="radio" class="input_radio" name="crowd_fund_radio" id="radio1" value="1" checked=""><label for="radio1">单选框</label></i>

    .input_radio {position: absolute; 20px;height: 20px;visibility: hidden;}
    .input_radio+label {display: inline-block; 120px;height: 20px;text-indent:18px;line-height:18px;color: #666666;background: url(../images/radio_no.png) left center no-repeat; float: left; margin:5px 10px 0px 10px;}
    .input_radio:checked+label {background: url(../images/radio_yes.png) left center no-repeat;}

  • 相关阅读:
    mapper.xml接收多个参数
    java循环调用多个timer定时器
    java执行cmd命令的两种方法
    java解压.ZIP .TAR等常用格式文件
    HDU2157 (水题)状态转移
    Codeforces Round #628 (Div. 2)C. Ehab and Path-etic MEXs(构造+树)
    POJ3735——mat乘法优化
    HDU5667——费马小定理
    UCF Local Programming Contest 2012(Practice) D. The Clock Algorithm
    嵌套递推——矩阵快速幂
  • 原文地址:https://www.cnblogs.com/miss1332/p/9837776.html
Copyright © 2020-2023  润新知