免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1474 | 回复: 0
打印 上一主题 下一主题

[Web] 在线等 !!哪位兄弟帮我分析一下这个js脚本完成的功能 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-15 16:39 |只看该作者 |倒序浏览
function createMenu(){
        var oTbl,oTR,oTD;

        oTbl = document.createElement("table");
        //otb1=document.craeateelement("table");

        oTbl.id = "tbl";
        oTbl.cellSpacing = "0";
        oTbl.className = "OTTable";

        oTR = oTbl.insertRow();
        oTD = oTR.insertCell(';
  echo ');
        if(dom.selectSingleNode("//menubar[@id=\'"+currentMenuId+"\']")==null){
                currentMenuId=0;
        }
        oTD.setAttribute("menuid",dom.selectSingleNode("//menubar[@id=\'"+currentMenuId+"\']").getAttribute("id"));
        oTD.className = "folder";
        oTD.innerHTML = "<img src=\'"+dom.selectSingleNode("//menubar[@id=\'"+currentMenuId+"\']").getAttribute("icon")+"\'/>" + dom.selectSingleNode("//menubar[@id=\'"+currentM';
  echo 'enuId+"\']").getAttribute("name");

        oTR = oTbl.insertRow();
        oTD = oTR.insertCell();
        oTD.id = "fileTD";
        oTD.className = "file";
        var oIframe = document.createElement("iframe");
        oIframe.id = "ifrm";
        oIframe.style.width = "100%";
        oIframe.style.height = "100%";
        oIframe.frameBorder = "0";
        oIframe.attachEvent("onload",loadHTML);
        oTD.appendChild(oIframe);

        oTR = oTbl.insertRow();
';
  echo '
        oTD = oTR.insertCell();
        oTD.className = "handle";
        oTD.onmousedown = function(){mousedown();};
        oTD.onmouseup = function(){mouseup();};
        oTD.onmousemove = function(){mousemove();};

        var oNodes = dom.selectNodes("//menubar");
        for(i=0;i<oNodes.length;i++){
                oTR = oTbl.insertRow();
                oTD = oTR.insertCell();
                oTD.setAttribute("menuid",dom.selectSingleNode("//menubar["+i+"]").getAttribu';
  echo 'te("id"));
                oTD.className = "folder";
                oTD.attachEvent("onmouseover",folderMouseOver);
                oTD.attachEvent("onmouseout",folderMouseOut);
                oTD.onclick = function(){slideFolder(this);};
                oTD.innerHTML = "<img src=\'"+dom.selectSingleNode("//menubar["+i+"]").getAttribute("icon")+"\'/>" + dom.selectSingleNode("//menubar["+i+"]").getAttribute("name");;
        }

        oTR = oTbl.insertRow();
        oTD = oTR.in';
  echo 'sertCell();
        oTD.id = "thumbBox";
        oTD.innerHTML = "<img id=\'rightArrow\' src=\'/images/menu/1/open_win_arrow.gif\' onclick=\'showFav()\'/>";
        document.getElementById("divMenuBox").rows[0].cells[0].appendChild(oTbl);
}
dSample Text
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP