本帖最后由 aaa8562373 于 2014-03-19 10:40:05 编辑

解决方案 »

  1.   

    <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>
      

  2.   

    <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>无效
      

  3.   

    $('.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);
                // }
                
            })
        })
      

  4.   

    谢谢你啊~,非常感谢,这个prop如果元素当前没设置这个属性是不是也可以获取~