<table class="table table-striped  sortable table-bordered table-hover " id="zdnews">
<thead>
<tr>
<th>运单号</th>
<th>发货人</th>
<th>收货人</th>
<th>货物信息</th>
<th id="payxf"><input type="checkbox" class="zdcheckbox">现付</th>
<th id="payxf1"><input type="checkbox" class="zdcheckbox">到付</th>
<th id="payxf2"><input type="checkbox" class="zdcheckbox">月结</th>
<th id="payxf3"><input type="checkbox" class="zdcheckbox">回执付</th>
<th id="payxf4"><input type="checkbox" class="zdcheckbox">返厂付</th>
<th >汇总费用</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="ddlook.html">100adggg3253445345454</a>
<br></td>
<td>俞亮
<br>山西省临汾市</td>
<td>匿名
<br>黑龙江省佳木斯市桦南县</td>
<td>龙岩,435件,127千克,32方</td>
<td><input type="checkbox" class="zdcheckbox">100</td>
<td><input type="checkbox" class="zdcheckbox">50</td>
<td><input type="checkbox" class="zdcheckbox">10</td>
<td><input type="checkbox" class="zdcheckbox">20</td>
<td><input type="checkbox" class="zdcheckbox">30</td>
<td><span class="colorred ">0</span></td>
</tr>
<tr>
<td>
<a href="ddlook.html">20adggg3253445345454</a>
<br></td>
<td>俞亮
<br>山西省临汾市侯马市</td>
<td>匿名
<br>黑龙江省佳木斯市桦南县</td>
<td>龙岩,435件,127千克,32方</td>
<td><input type="checkbox" class="zdcheckbox">20</td>
<td><input type="checkbox" class="zdcheckbox">30</td>
<td><input type="checkbox" class="zdcheckbox">40</td>
<td><input type="checkbox" class="zdcheckbox">50</td>
<td><input type="checkbox" class="zdcheckbox">60</td>
<td><span class="colorred ">0</span></td>
</tr>
<tr>
<td>
<a href="ddlook.html">40adggg3253445345454</a>
<br></td>
<td>俞亮
<br>山西省临汾市侯马市</td>
<td>匿名
<br>黑龙江省佳木斯市桦南县</td>
<td>龙岩,435件,127千克,32方</td>
<td><input type="checkbox" class="zdcheckbox">40</td>
<td><input type="checkbox" class="zdcheckbox">10</td>
<td><lable><input type="checkbox" class="zdcheckbox">20</td>
<td><input type="checkbox" class="zdcheckbox">30</td>
<td><input type="checkbox" class="zdcheckbox">50</td>
<td><span class="colorred ">0</span></td>
</tr> </tbody>
</table>
<script>
//现付
$("#payxf").bind("click",function () {
if ($(this).hasClass("checkth")) {
$("#zdnews tr").each(function(){
$(this).find('td').eq(4).find(':checkbox').attr('checked',false);
$(this).find('th').eq(4).find(':checkbox').attr('checked',false);
$(this).find('td').eq(4).removeClass("checkth");
$(this).find('th').eq(4).removeClass("checkth");
})
} else {
$("#zdnews tr").each(function(){
$(this).find('td').eq(4).find(':checkbox').attr('checked',true);
$(this).find('th').eq(4).find(':checkbox').attr('checked',true);
$(this).find('td').eq(4).addClass('checkth');
$(this).find('th').eq(4).addClass('checkth');
})
}
});
//到付
$("#payxf1").bind("click",function () {
if ($(this).hasClass("checkth")) {
$("#zdnews tr").each(function(){
$(this).find('td').eq(5).find(':checkbox').attr('checked',false);
$(this).find('th').eq(5).find(':checkbox').attr('checked',false);
$(this).find('td').eq(5).removeClass("checkth");
$(this).find('th').eq(5).removeClass("checkth");
})
} else {
$("#zdnews tr").each(function(){
$(this).find('td').eq(5).find(':checkbox').attr('checked',true);
$(this).find('th').eq(5).find(':checkbox').attr('checked',true);
$(this).find('td').eq(5).addClass('checkth');
$(this).find('th').eq(5).addClass('checkth');
})
}
});
//月结
$("#payxf2").bind("click",function () {
if ($(this).hasClass("checkth")) {
$("#zdnews tr").each(function(){
$(this).find('td').eq(6).find(':checkbox').attr('checked',false);
$(this).find('th').eq(6).find(':checkbox').attr('checked',false);
$(this).find('td').eq(6).removeClass("checkth");
$(this).find('th').eq(6).removeClass("checkth");
})
} else {
$("#zdnews tr").each(function(){
$(this).find('td').eq(6).find(':checkbox').attr('checked',true);
$(this).find('th').eq(6).find(':checkbox').attr('checked',true);
$(this).find('td').eq(6).addClass('checkth');
$(this).find('th').eq(6).addClass('checkth');
})
}
});
//回执付
$("#payxf3").bind("click",function () {
if ($(this).hasClass("checkth")) {
$("#zdnews tr").each(function(){
$(this).find('td').eq(7).find(':checkbox').attr('checked',false);
$(this).find('th').eq(7).find(':checkbox').attr('checked',false);
$(this).find('td').eq(7).removeClass("checkth");
$(this).find('th').eq(7).removeClass("checkth");
})
} else {
$("#zdnews tr").each(function(){
$(this).find('td').eq(7).find(':checkbox').attr('checked',true);
$(this).find('th').eq(7).find(':checkbox').attr('checked',true);
$(this).find('td').eq(7).addClass('checkth');
$(this).find('th').eq(7).addClass('checkth');
})
}
});
//返厂付
$("#payxf4").bind("click",function () {
if ($(this).hasClass("checkth")) {
$("#zdnews tr").each(function(){
$(this).find('td').eq(8).find(':checkbox').attr('checked',false);
$(this).find('th').eq(8).find(':checkbox').attr('checked',false);
$(this).find('td').eq(8).removeClass("checkth");
$(this).find('th').eq(8).removeClass("checkth");
})
} else {
$("#zdnews tr").each(function(){
$(this).find('td').eq(8).find(':checkbox').attr('checked',true);
$(this).find('th').eq(8).find(':checkbox').attr('checked',true);
$(this).find('td').eq(8).addClass('checkth');
$(this).find('th').eq(8).addClass('checkth');
})
}
}); // 单个选择
$("#zdnews tbody tr").each(function(){
$(this).find('td').bind("click",function () {
if ($(this).hasClass("checkth")) {
$(this).find(':checkbox').attr('checked',false);
$(this).removeClass("checkth"); } else {
$(this).find(':checkbox').attr('checked',true);
$(this).addClass('checkth');
}
});
// })
</script>

table中列复选框全选,再选 效果的更多相关文章

  1. jQuery中的几个案例:隔行变色、复选框全选和全不选

    1 表格隔行变色 1 技术分析: 1 )基本过滤选择器: odd: even: 2 )jq添加和移除样式: addClass(); removeClass(); 2 代码实现 <script s ...

  2. checkbox复选框全选批量删除

    多选框全选实现批量删除 html代码 <body> <form action="" method="post" name="Form ...

  3. FineReport——JS二次开发(复选框全选)

    在进行查询结果选择的时候,我们经常会用到复选框控件,对于如何实现复选框全选,基本思路: 在复选框中的初始化事件中把控件加入到一个全局数组里,然后在全选复选框里对数组里的控件进行遍历赋值. 首先,定义两 ...

  4. html+css+js实现复选框全选与反选

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...

  5. jQuery 复选框全选/取消全选/反选

    jQuery实现的复选框全选/取消全选/反选及获得选择的值. 完整代码: <!DOCTYPE html> <html> <head> <script type ...

  6. js 判断 复选框全选、全不选、反选、必选一个

    一个挺 使用的 js 代码片段,  判断  复选框全选.全不选.反选.必选一个 记录下, 搬来的 思路: 修改数据的 选中与否状态, 拿到所有的输入框,看是否有选中的状态 <html> & ...

  7. js 复选框 全选都选 如果某一个子复选框没选中 则全选按钮不选中

    <!DOCTYPE HTML> <html> <head> <meta charset=UTF-8> <title>js 复选框 全选都选 ...

  8. JavaScript小例子:复选框全选

    JavaScript小例子:复选框全选 这只是一个小例子,很简单,但是这个功能还是很常用的: 实现后效果如图: JavaScript代码: <script type="text/jav ...

  9. Jquery表格变色 复选框全选,反选

    /*jquery静态表格变色*/ $(".tr2").mouseover(function(){ $(this).css("background"," ...

随机推荐

  1. MySQL数据库(二)

    1.模糊查询like 在where 后面使用like 通配符: % 任意字符 _ 单个字符 2.order by 排序 order by price //默认升序排序 order by price d ...

  2. 【Selenium专题】FAQ_浏览器_ChromeDriver版本导致报错

    报错信息 Started ChromeDriver port=31984 version=23.0.1240.0 log=C:\workspace\test\chromedriver.log [063 ...

  3. 9、select 语句

    基础语句 select * from tb1; select * from tb1 limit 3; select name,age from tb1; select name,age from tb ...

  4. bzoj2705Longge的问题

    题目链接 题意很简单 $$ans=\sum_{i=1}^{n}gcd(i,n)$$ 然后推一下式子,求一下欧拉函数就好了 细节是由于$BZOJ$的评测计时策略, 不能线性筛啊$……$ 必须每个数单独筛 ...

  5. Python 验证码识别(别干坏事哦...)

    关于python验证码识别库,网上主要介绍的为pytesser及pytesseract,其实pytesser的安装有一点点麻烦,所以这里我不考虑,直接使用后一种库. python验证码识别库安装 要安 ...

  6. Extjs在form展示后台单个对象的属性

    目的:写一个按钮事件,点击时弹出一个win窗体,里面镶嵌form表单,并且展示后台单个对象的属性 先来后台: public void find(){ String clientId = request ...

  7. maven初步了解

    目标:创建一个父maven项目,有两个子项目分别为serverCenter,dbConnector. 建议:全程不要导入Jar包,全部使用maven依赖的方式导入包. 1.创建maven项目 这个创建 ...

  8. Timer分析

    学而时习之,不亦说乎!                              --<论语> Java的JDK中自带的任务调度实现.简单易用,源码也很清晰,总共由四个类组成,都在Time ...

  9. 服务端模拟http服务请求客户端

    try { InputStream in = req.getInputStream(); int i = -1; ByteArrayOutputStream out = new ByteArrayOu ...

  10. Java - 二分法查找(尚学堂第七章数组)

    import java.util.Arrays; public class TestBinarySearch { public static void main(String[] args) { in ...