<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. Django 标签过滤器

    django内置标签 autoescape 控制当前的自动转义行为.这个标记可以作为参数打开或关闭,它决定自动转义是否在块内有效.块使用endautoescape结束标记关闭. 当自动转义生效时,所有 ...

  2. 重新理解javascript回调函数

    把函数作为参数传入到另一个函数中.这个函数就是所谓的回调函数 经常遇到这样一种情况,某个项目的A层和B层是由不同的人员协同完成.A层负责功能funA,B层负责funcB.当B层要用到某个模块的数据,于 ...

  3. 清北学堂(2019 4 30 ) part 3

    今天总的讲些算法,会了的话...看上去好厉害的样子: 1.老朋友动态规划DP: DP重点: 1.边界条件,开头不需处理的数据,比如斐波那契数列中的第一二项 2.转移方程,后面的项需要根据前面几项求出自 ...

  4. C#面向对象二

    1.方法的定义 概念:对象的动态特征就是方法(静态特征是属性),方法表示此对象可以做什么. 类型:实例方法,静态方法,(构造方法,多态时会用到抽象方法和虚方法) 2.注意事项 访问修饰符:默认priv ...

  5. leetcode 213. 打家劫舍 II JAVA

    题目: 你是一个专业的小偷,计划偷窃沿街的房屋,每间房内都藏有一定的现金.这个地方所有的房屋都围成一圈,这意味着第一个房屋和最后一个房屋是紧挨着的.同时,相邻的房屋装有相互连通的防盗系统,如果两间相邻 ...

  6. Servlet实现禁用cookie重写URL获取session

    前言 一个女人让他的程序员丈夫去商店买东西:你去附近的商店买些鸡蛋,如果有香蕉的话,买8个回来,这个丈夫买了8个鸡蛋回来,他的妻子大吃一惊:你为什么买了8个鸡蛋?! 程序员丈夫回答:因为他们有香蕉. ...

  7. Win8.1下安装sql server 2008 r2详解

    我是来斗图的,安装了好多次,有一些配置还是不能烂熟于心啊,所以就想起来了米老师那句话,学习是个反复的过程.写个教程吧,很简单但是很实用. 首先打开"setup.exe"出现以下界面 ...

  8. CentOS6.9 minimal版本安装图形化界面

    CentOS6.9 minimal版本安装图形化界面 安装步骤如下: 1.安装Desktop组 # yum groupinstall "Desktop" -y 2.安装X Wind ...

  9. JQuery实现全选、反选和取消功能

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. PHP内核研究:HASH表和变量 【转】

    PHP HASH表 在PHP中,所有的数据 无论变量,常量,类,属性 都用Hash表来实现. 先要说说 HASH表 typedef struct bucket { ulong h;           ...