如图 我想让禁用的checkbox我按全选他也是不勾选的。。 本帖最后由 aaa8562373 于 2014-03-19 10:40:05 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-beta1.js"></script></head><body> <input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" disabled /><input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" /> <script type="text/javascript"> $(function(){ //console.log($(".check")) $(".chebox").each(function(){ if(!$(this).is(':disabled')){ $(this).prop('checked',true); } }) }) </script></body></html> <div class='import_layout'> <!--导入进度--> <div class='progress'> <div class='fl back94c047 w34 progress_list'> <div class='green_head'></div> 1.上传导入文件 <div class='green_bottom_round'></div> </div> <div class='fl back94c047 w34 progress_list'> 2.确定导入信息 <div class='green_bottom'></div> </div> <div class='fl w32 progress_list'> 3.导入成功 <div class='grey_bottom_round'></div> </div> <div class='cl'></div> </div> <!--导入区域内容--> <div class='import_cont bs_item'> <div class='import_cont_title'>2.确定导入信息</div> <div class='import_view_title'><p>共导入20条信息,符合要求18条,不符合要求2条<span class='red'>(注:标注红色为不符合要求信息)</span></p></div> <div class='pL5'>系统已为导入数据匹配对应信息类别,如有问题,您可以自行调整</div> </div> <div class="import_view_cont"> <form action=''> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="promotion_list_title"> <tbody> <tr> <th width="10%"><input type='checkbox' class='chebox'>全选</th> <th width="10%">会员姓名</th> <th width="15%">手机号码</th> <th width="10%">性别</th> <th width="15%">身份证号</th> <th width="15%">电子邮箱</th> <th width='10%'>QQ</th> <th>会员积分</th> </tr> </tbody> </table> <div class='import_view_table'> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="promotion_list_table import_tabel"> <tbody> <tr> <td width="10%"><input type='checkbox' ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> <tr class='red'> <td width="10%"><input type='checkbox' disabled="disabled" ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> <tr> <td width="10%"><input type='checkbox' ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> <tr> <td width="10%"><input type='checkbox' ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> <tr> <td width="10%"><input type='checkbox' ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> <tr> <td width="10%"><input type='checkbox' ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> <tr> <td width="10%"><input type='checkbox' ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> <tr> <td width="10%"><input type='checkbox' ></td> <td width="10%">李磊</td> <td width="15%">151648574846</td> <td width="10%">男</td> <td width='15%'>1234567851556165</td> <td width='15%'>[email protected]</td> <td width='10%'>4546546</td> <td>332</td> </tr> </tbody> </table> </from> </div> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="promotion_list_title" style='border:none'> <tbody> <tr> <th width="10%"><input type='checkbox' class='chebox' checked = 'checked'>全选</th> <th width='90%'></th> </tr> </tbody> </table> </div> <div class='pT62 but_w'> <input type='submit' value = '导入' class='but_4174b4 fl marginR50'> <input type='button' value = '上一步' class='but_7baae5 fl'> <div class='cl'></div> </div> </div><script type="text/javascript">$(document).ready(function(){ //checkbox的选择 var box = $("input[type='checkbox']"); $('.chebox').each(function(){ $('.chebox').click(function(){ if(!box.is(':disabled')){ alert(1); box.prop('checked',true); } }) }) });</script>无效 $('.chebox').each(function(){ $(this).click(function(){ if($(this).prop('checked')){ //$('.chebox').prop('checked',true); $(":checkbox").each(function(){ if(!$(this).is(':disabled')){ $(this).prop('checked',true); } }) }else{ $(":checkbox").each(function(){ $(this).prop('checked',false); }) } // if(!box.is(':disabled')){ // alert(1); // box.prop('checked',true); // } }) }) 谢谢你啊~,非常感谢,这个prop如果元素当前没设置这个属性是不是也可以获取~ Extjs4.0 手风琴对象的面板选中事件是什么?? 一个初学者的问题 window.top如何在带有frameset或者是iframe的框架页面使用 请教一个在线绘图板的PHP或Javascript脚本 求熟悉WebFXTree的大虾帮帮忙 麻烦高手帮我看一下这段代码.不是很清楚~~~ 强制 iframe中的链接跳出 仿select下拉框 怎样使字符画更小,且层的大小不要改变(以下为代码) 怎么判断一个同名的Select下拉框 数组 不能有相同的值???急,多谢了!!! 怎么实现JS类私有属性? jquery 怎么获取2个元素之间的同胞元素。
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0-beta1.js"></script>
</head><body>
<input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" disabled /><input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" /><input type="checkbox" class="chebox" /> <script type="text/javascript"> $(function(){
//console.log($(".check"))
$(".chebox").each(function(){
if(!$(this).is(':disabled')){
$(this).prop('checked',true);
}
})
})
</script>
</body>
</html>
<!--导入进度-->
<div class='progress'>
<div class='fl back94c047 w34 progress_list'>
<div class='green_head'></div>
1.上传导入文件
<div class='green_bottom_round'></div>
</div>
<div class='fl back94c047 w34 progress_list'>
2.确定导入信息
<div class='green_bottom'></div>
</div>
<div class='fl w32 progress_list'>
3.导入成功
<div class='grey_bottom_round'></div>
</div>
<div class='cl'></div>
</div>
<!--导入区域内容-->
<div class='import_cont bs_item'>
<div class='import_cont_title'>2.确定导入信息</div>
<div class='import_view_title'><p>共导入20条信息,符合要求18条,不符合要求2条<span class='red'>(注:标注红色为不符合要求信息)</span></p></div>
<div class='pL5'>系统已为导入数据匹配对应信息类别,如有问题,您可以自行调整</div>
</div>
<div class="import_view_cont">
<form action=''>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="promotion_list_title">
<tbody>
<tr>
<th width="10%"><input type='checkbox' class='chebox'>全选</th>
<th width="10%">会员姓名</th>
<th width="15%">手机号码</th>
<th width="10%">性别</th>
<th width="15%">身份证号</th>
<th width="15%">电子邮箱</th>
<th width='10%'>QQ</th>
<th>会员积分</th>
</tr>
</tbody>
</table>
<div class='import_view_table'>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="promotion_list_table import_tabel">
<tbody>
<tr>
<td width="10%"><input type='checkbox' ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
<tr class='red'>
<td width="10%"><input type='checkbox' disabled="disabled" ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
<tr>
<td width="10%"><input type='checkbox' ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
<tr>
<td width="10%"><input type='checkbox' ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
<tr>
<td width="10%"><input type='checkbox' ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
<tr>
<td width="10%"><input type='checkbox' ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
<tr>
<td width="10%"><input type='checkbox' ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
<tr>
<td width="10%"><input type='checkbox' ></td>
<td width="10%">李磊</td>
<td width="15%">151648574846</td>
<td width="10%">男</td>
<td width='15%'>1234567851556165</td>
<td width='15%'>[email protected]</td>
<td width='10%'>4546546</td>
<td>332</td>
</tr>
</tbody>
</table>
</from>
</div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="promotion_list_title" style='border:none'>
<tbody>
<tr>
<th width="10%"><input type='checkbox' class='chebox' checked = 'checked'>全选</th>
<th width='90%'></th>
</tr>
</tbody>
</table>
</div>
<div class='pT62 but_w'>
<input type='submit' value = '导入' class='but_4174b4 fl marginR50'>
<input type='button' value = '上一步' class='but_7baae5 fl'>
<div class='cl'></div>
</div>
</div><script type="text/javascript">
$(document).ready(function(){ //checkbox的选择
var box = $("input[type='checkbox']");
$('.chebox').each(function(){
$('.chebox').click(function(){
if(!box.is(':disabled')){
alert(1);
box.prop('checked',true);
}
})
})
});</script>无效
$(this).click(function(){
if($(this).prop('checked')){
//$('.chebox').prop('checked',true);
$(":checkbox").each(function(){
if(!$(this).is(':disabled')){
$(this).prop('checked',true);
}
})
}else{
$(":checkbox").each(function(){
$(this).prop('checked',false);
})
}
// if(!box.is(':disabled')){
// alert(1);
// box.prop('checked',true);
// }
})
})