jquery设置table中td隐藏显示 俗称动态列
2013-03-28 00:00
806 查看
function checkMyCase(){ var s = document.getElementsByName("case"); var s2 = ""; var b1,b2,b3; for( var i = 0; i < s.length; i++ ) { if (s[i].checked ){ if(s[i].value=="1"){ b1=true; } if(s[i].value=="2"){ b2=true; } if(s[i].value=="3"){ b3=true; } } } $("#mytable tr").find('td:eq(1)').hide(); $("#mytable tr").find('td:eq(2)').hide(); $("#mytable tr").find('td:eq(3)').hide(); if(b1==true){ $("#mytable tr").find('td:eq(1)').show(); } if(b2==true){ $("#mytable tr").find('td:eq(2)').show(); } if(b3==true){ $("#mytable tr").find('td:eq(3)').show(); } }
相信基础的checkbox,我未定义大家都看的懂把。
相关文章推荐
- jquery设置table中td隐藏显示
- js动态控制td隐藏显示 jquery 动态控制td被另一个td代替,非常实用
- JQuery动态显示和隐藏div
- Extjs form表单 动态设置标签的隐藏和显示 (解决问题)
- jquery 给table里的td动态创建控件并处理
- jquery实现隐藏与显示动画效果/输入框字符动态递减/导航按钮切换
- 动态改变tableHeaderView的显示隐藏及高度
- JQuery DIV 动态隐藏和显示的方法
- jquery实现隐藏显示层动画效果、仿新浪字符动态输入、tab效果
- HTML:table中的td文字隐藏并实现hover显示全部文字
- EditText的换行输入、输入起始位置、调用指定格式的系统键盘(显示和隐藏),光标颜色,密码动态设置可见性
- table中td隐藏溢出文字,鼠标停留显示
- jquery下动态显示jqGrid以及jqGrid的属性设置容易出现问题的解决方法
- jQuery动态显示和隐藏datagrid中的某一列的方法
- jquery 设置button可用不可用以及隐藏和显示
- jquery each控制checkbox有关内容(table tr)的显示或隐藏(jquery 按条件隐藏显示已输出内容)
- jQuery 设置控件的显示与隐藏
- jquery.dataTables表格列 动态显示隐藏(加工) checkbox刷新保持不变
- 动态设置EditText密码的显示和隐藏
- jQuery实现页面滚动时顶部动态显示隐藏