java多级菜单代码 java菜单栏代码( 二 )


for (i = 0; ifield.length; i++) {
if(field[i].checked == true){
field[i].disabled = true;
checkflag = "false";
selectflag = "false";
}
}
}
//------取消选取--------
function cancelAll(field){
//field = myform.all;
field = document.getElementById("myform");
for (i = 0; ifield.length; i++) {
field[i].checked = false;
field[i].disabled=false;
checkflag = "false";
selectflag = "false";
}
}
//单击提交页面
function onSubit(){
var txt = "";
//field = myform.all;
field = document.getElementById("myform");
for (i = 0; ifield.length; i++) {
if(field[i].checked == truefield[i].disabled==false){
txt += field[i].value+".";
}
}
//alert("=="+txt);
//取得父窗口对象
var winOpen=window.opener;
winOpen.document.form.fundtype.value=https://www.04ip.com/post/txt;
window.close();
}
//End --
/script
/head
bodyonLoad="disabledAll()"
script type="text/javascript" src="/images/defaultpic.gif"/script
form name="myform"method="post" id="myform"
table width="250" border="0" cellspacing="0" cellpadding="5"
tr
td colspan="2"table width="100%"cellpadding=0 cellspacing=0 bgcolor="#FFFFFF"
tr
td基金投资类型/td
/tr
tr
td
div class="dtree"
script type="text/javascript"
!--//
d = new dTree('d');
${tree}
document.write(d);
//--
/script
/div
/td
/tr
/table/td
/tr
tr height="25"
td width="86" height="0"align="center"a href="https://www.04ip.com/post/#" onClick="onSubit()"img src="/images/defaultpic.gif"/a/td
td width="144" height="0"a href="https://www.04ip.com/post/#" onClick="cancelAll()"img src="/images/defaultpic.gif"/a/td
/tr
/table
/form
/body
/html
3 。js文件:
// Node object
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 object
function 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: './fund/menu/img/base.gif',
folder: './fund/menu/img/folder.gif',
folderOpen : './fund/menu/img/folderopen.gif',
node: './fund/menu/img/page.gif',
empty: './fund/menu/img/empty.gif',
line: './fund/menu/img/line.gif',
join: './fund/menu/img/join.gif',
joinBottom : './fund/menu/img/joinbottom.gif',
plus: './fund/menu/img/plus.gif',
plusBottom : './fund/menu/img/plusbottom.gif',
minus: './fund/menu/img/minus.gif',
minusBottom : './fund/menu/img/minusbottom.gif',
nlPlus: './fund/menu/img/nolines_plus.gif',
nlMinus: './fund/menu/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;
};
// Adds a new node to the node array
dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {
this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);

推荐阅读