麻烦问下各位高手,怎么用javascript写一个树形菜单,树形菜单里的数据是动态的,从数据库得到,我在网上找了很多,但都用不来,希望大家给我一段代码,要有注释,还有JS函数里传递的参数都要解释下,麻烦了,确实是新手,希望各位高手指教,要很详细很详细很详细很详细很详细很详细很详细很详细很详细很详细很详细很详细!!!谢谢
解决方案 »
- http://www.zhuna.cn/search____0_0_1_0_2.html?city=%E5%8C%97%E4%BA%AC&tal=1277
- gridview问题
- 大家帮我看看,登陆代码?
- 如何根据用户的邮箱名称获得此邮箱的邮件服务器(在线等)
- 怎么把datagrid里的模版列里的的button的type修改掉?
- 我用Response.Write("<SCRIPT>window.open ()</SCRIPT>")弹出一个从数据库显示图片的窗口,问下怎么自动关闭它?
- 关于Excel Sheet Visible 的问题????在线
- 大家帮我看看这段代码
- 邮件发送的问题(代码也写了,有问题)
- 调用存储过程问题?
- firefox 中iframe 调用父窗口自定义函数怎么写
- 能不能把这个两个功能放在一起?——真的要分开写吗?
那么多免费的自己写多费神还浪费时间精力;并且没有经济效益.
再说了楼主也没拿干那个事情的薪水吧(估计是了),好好劳动
function Node(id, pid, name, url, title, target, icon, iconOpen, open) { this.id = id; this.pid = pid; this.name = name; this.url = url; this.title = title; this.target = target; this.icon = icon; this.iconOpen = iconOpen; this._io = open || false; this._is = false; this._ls = false; this._hc = false; this._ai = 0; this._p;};// Tree objectfunction dTree(objName) { this.config = { target : null, folderLinks : true, useSelection : true, useCookies : true, useLines : true, useIcons : true, useStatusText : false, closeSameLevel : false, inOrder : false } this.icon = { root : '../img/root.gif', folder : '../img/folder.gif', folderOpen : '../img/folderopen.gif', node : '../img/node.gif', empty : '../img/empty.gif', line : '../img/line2.gif', join : '../img/join.gif', joinBottom : '../img/joinbottom.gif', plus : '../img/plus.gif', plusBottom : '../img/plusbottom.gif', minus : '../img/minus.gif', minusBottom : '../img/minusbottom.gif', nlPlus : '../img/nolines_plus.gif', nlMinus : '../img/nolines_minus.gif' }; this.obj = objName; this.aNodes = []; this.aIndent = []; this.root = new Node(-1); this.selectedNode = null; this.selectedFound = false; this.completed = false;};
这是定义的一部分,其他的你自己来定义,加进去就好了。需要动态的话,定义一个div,用innnerHtml输出,转成字符串后,读出来的东西加进去就好了。
http://www.open-open.com/ajax/ajax20080531234600.htm
<span><h1>请选择查询日期(年月日)</h1></span>
<div id="panel">
<br />
报告日期: <lable>年 </lable><input type="text" style="width: 40px; height: 12px" />
<lable>月</lable><input type="yue" style="width: 24px; height: 12px">
<lable>日</lable><input type="yue" style="width: 24px; height: 12px"></div>
<div id="pane2">
<br />
报告日期(选择F1帮助): <lable>年 </lable><input type="text" style="width: 40px; height: 12px" />
<lable>月</lable><input type="yue" style="width: 24px; height: 12px">
<lable>日</lable><input type="yue" style="width: 24px; height: 12px"></div>
<br />
<br />
<input type="checkbox" /><lable>登陆</lable>
<input type="button" value="提交" />
<input type="button" value="取消" /><a href="javascript:close();">关闭</a>
这是我的小窗口代码,但是我不知道怎么套到根节点去???
http://paranimage.com/11-javascript-tree-menus/