I have six divas and checkboxes on them. How to make these divas disappear when there are ticks at all, and one big new one appears?
Closed due to the fact that the issue is too general for participants lexxl , pavel , user194374, Abyx , user207618 Aug 11 '16 at 20:18 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
- What do you mean by one big new one appeared - Ninazu
- code please? - C.Raf.T
- jsfiddle.net/9424uzon/8 In order for these to disappear and one big one appeared over them and it was written “Completed” - Ilya Osmanov
|
1 answer
<div> <div class="checkbox-block-info" style="display: none"> Выполнено </div> <div class="checkbox-block"> <div> <input type="checkbox" class="checkbox-row"> </div> <div> <input type="checkbox" class="checkbox-row"> </div> </div> </div> <hr> <div> <div class="checkbox-block-info" style="display: none"> Выполнено </div> <div class="checkbox-block"> <div> <input type="checkbox" class="checkbox-row"> </div> <div> <input type="checkbox" class="checkbox-row"> </div> </div> </div> <script> $('.checkbox-row').on('change', function(){ var block = $(this).parents('.checkbox-block'); if (block.find('.checkbox-row').length == block.find('.checkbox-row:checked').length) { block.siblings('.checkbox-block-info').show(); block.hide(); } }); </script>
|