CODE (javascript):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <script type="text/javascript">
- $(document).ready(function (){
- $('input:checkbox').click(function (){
- var ok=this.checked;
- //this.checked=!ok;
- $(this).next().find('input:checkbox').each(function (){
- this.checked=ok;
- });
- if (ok) {
- $(this).parents('li').children('input:checkbox').each(function (){
- this.checked=true;
- });
- } else {
- $(this).parent().parents('li').each(function (){
- if ($(this).find('input:checked').length>1) return false;
- $(this).children('input:checkbox').get(0).checked=false;
- });
- };
- });
- });
- </script>