当前位置:学会吧培训频道电脑知识学习网页制作Javascript教程Javascript关于树形菜单,Checkbox的全选» 正文

Javascript关于树形菜单,Checkbox的全选

[08-08 00:41:28]   来源:http://www.xuehuiba.com  Javascript教程   阅读:8221
概要: } // 子类 if (parentElement.pid > "0") { chk[0].checked = checked; var parentObj; // 父类对象 for (var i=0; i<count; i++) { if (chk[i].parentElement.id == parentElement.pid) // 选中父
Javascript关于树形菜单,Checkbox的全选,标签:javascript视频教程,javascript教程下载,http://www.xuehuiba.com
                        }
                        // 子类
                        if (parentElement.pid > "0")
                        {
                                chk[0].checked = checked;
                                var parentObj;        // 父类对象
                                for (var i=0; i<count; i++)
                                {
                                        if (chk[i].parentElement.id == parentElement.pid)        // 选中父类
                                        {
                                                parentObj = chk[i];        // http://www.knowsky.com/tools/wangzhansuduceshi.asp 将父类对象赋于一个变量
                                                chk[i].checked = checked;
                                        }
                                        if (chk[i].parentElement.pid == parentElement.pid)        // 如果子类中有一项没有选中,将父类的选中取消
                                        {
                                                if (!chk[i].checked) parentObj.checked = false;
                                        }
                                        if (!chk[i].checked) chk[0].checked = false;
                                }

上一页  [1] [2] [3] [4]  下一页


Tag:Javascript教程javascript视频教程,javascript教程下载电脑知识学习 - 网页制作 - Javascript教程
Copyright 学会吧 All Right Reserved.
在线学习社区!--学会吧
1 2 3 4 5 6 7 7 8 9 10 11 12 13