本帖最后由 molaifeng 于 2012-07-25 20:18:01 编辑

解决方案 »

  1.   

    $(document).ready( function() {
    $("input[name='ck[]']").click( function() {
    var o = $("input[name='ck[]']");
    if (o.filter(":checked").length == 3) o.not(":checked").attr("disabled", "disabled");
    else o.not(":enabled").removeAttr("disabled");
    });
    });复选框name属性值改为ck[]
      

  2.   

    $(function () {
        $('input[name="ck"]').click(function() {
           if($('input[name="ck"]:checked').size()==3)$('input[name="ck"]').not(':checked').attr('disabled',true);
       else $('input[name="ck"]:disabled').attr('disabled',false);
        })
    })
      

  3.   


    $(function () {
    $('input[name="ck"]').change(function() {
    var count = 0;
    $('input[name="ck"]').each(function () {
    if($(this).attr('checked') == true){
    count++;
    }
    if(count == 3){
                    $('input[name="ck"]').each(function () {
                        if($(this).attr('checked') == false){
            $(this).attr('disabled',true);
            }
                    })
                 }
                 else if(count <= 2) {
                    $('input[name="ck"]').each(function () {
                        if($(this).attr('disabled') == true){
            $(this).attr('disabled',false);
            }
                    })
                 }
    })
    })
    })刚刚自己又写了下,可以完成,不过方法太笨,有简化的么
      

  4.   

    浮动层+lightbox而已,参考lightbox实现的checkbox联动