Hallo Leute,
ich habe ein kleines Problem. Ich habe ein Navigationsscript, weiß aber leider nicht, wie ich eine 2 (3) Ebene hinzufügen kann. Z.B: Klickt man Test1 klappt Test1.1 aus, klickt man darauf klickt Test1.2 aus und so weiter...
Kann mir da jemand helfen ?
Ich danke!
Elch 5
Hier das Script:
<script>
<!-- Beginning of JavaScript -
var menublock=new Array() // no need to change this
var plus_i=0 // no need to change this
// The following block is different. It contains a mainlink without submenus.
// Take care to set the ";;;;" exactly as seen below.
menublock[0]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Test1|main.html|main;" // text and URL of mainlink
menublock[1]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
"Verdana;"+ // font sublinks
"3;"+ // fontsize sublinks
"FFFFFF;"+ // fontcolor sublinks
"0;"+ // fontweight sublinks, 1 means bold, 0 means normal
"Test3|#|;"+ // text|URL|target of mainlink
"submenu 1.1|submenu11.html|main;"+ // text|URL|target of first sublink
"submenu 1.2|submenu12.html|main;" // text|URL|target of second sublink
menublock[2]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
"Verdana;"+ // font sublinks
"3;"+ // fontsize sublinks
"FFFFFF;"+ // fontcolor sublinks
"0;"+ // fontweight sublinks, 1 means bold, 0 means normal
"Test4|#|;"+ // text and URL of first mainlink
"submenu 2.1|submenu21.html|main;"+ // text|URL|target of mainlink
"submenu 2.2|submenu22.html|main;"+ // text|URL|target of first sublink
"submenu 2.3|submenu23.html|main;"+ // text|URL|target of second sublink
"submenu 2.4|submenu24.html|main;"+ // text|URL|target of thirth sublink
"submenu 2.5|submenu25.html|main;" // text|URL|target of fourth sublink
menublock[3]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Kontakt|main.html|main;" // text and URL of mainlink
menublock[4]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Home|main.html|main;" // text and URL of mainlink
// No need to change anything below
// **********************************************************************************
var menusplit
var urlsplit
var font_weight_main
var font_weight_sub
var font_weight_sub
var minusimg=new Image()
minusimg.src="minus131.gif"
var plusimg=new Image()
plusimg.src="plus131.gif"
var showsubmenus=new Array()
for (i=0;i<=menublock.length-1;i++) {
showsubmenus[i]=-1
}
var plusminusimg=new Array()
for (i=0;i<=menublock.length-1;i++) {
plusminusimg[i]=plusimg.src
}
function openandclose(visi) {
showsubmenus[visi]=(-1)*showsubmenus[visi]
var menucontent=""
if (showsubmenus[visi]==1) {plusminusimg[visi]=minusimg.src}
if (showsubmenus[visi]==-1) {plusminusimg[visi]=plusimg.src}
menucontent+="<table border=0>"
for (i=0;i<=menublock.length-1;i++) {
menusplit=menublock[i].split(";")
urlsplit=menusplit[8].split("|")
if (menusplit[3]==1) {font_weight_main="<b>"}
if (menusplit[3]==0) {font_weight_main=""}
if (menusplit[7]==1) {font_weight_sub="<b>"}
if (menusplit[7]==0) {font_weight_sub=""}
menucontent+="<tr><td>"
if (menusplit[9].length==0) {
menucontent+="</td>"
menucontent+="<td>"
menucontent+=font_weight_main
menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+">"
menucontent+="<font face="+menusplit[0]+" color="+menusplit[2]+" size="+menusplit[1]+">"
menucontent+=urlsplit[0]
menucontent+="</font></a></td></tr>"
plus_i++
}
if (menusplit[9].length!=0) {
var thismainmenu=i+plus_i
menucontent+="<a href='javascriptpenandclose("+i+")'>"
menucontent+="<img src='"+plusminusimg[i]+"' border=0></a></td>"
menucontent+="<td>"
menucontent+=font_weight_main
menucontent+="<a href='javascriptpenandclose("+i+")'>"
menucontent+="<font face="+menusplit[0]+" color="+menusplit[2]+" size="+menusplit[1]+">"
menucontent+=urlsplit[0]
menucontent+="</font></a></td></tr>"
if (showsubmenus[i]==1) {
for (ii=9;ii<=menusplit.length-1;ii++) {
urlsplit=menusplit[ii].split("|")
menucontent+="<tr><td></td><td>"
menucontent+=font_weight_sub
menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+">"
menucontent+="<font face="+menusplit[4]+" color="+menusplit[6]+" size="+menusplit[5]+">"
menucontent+=urlsplit[0]
menucontent+="</font></a></td></tr>"
}
}
}
}
menucontent+="</table>"
if (document.all) {
menu.innerHTML=menucontent
}
if (document.layers) {
document.menu.document.write(menucontent)
document.menu.document.close()
}
}
// - End of JavaScript - -->
</script>
ich habe ein kleines Problem. Ich habe ein Navigationsscript, weiß aber leider nicht, wie ich eine 2 (3) Ebene hinzufügen kann. Z.B: Klickt man Test1 klappt Test1.1 aus, klickt man darauf klickt Test1.2 aus und so weiter...
Kann mir da jemand helfen ?
Ich danke!
Elch 5
Hier das Script:
<script>
<!-- Beginning of JavaScript -
var menublock=new Array() // no need to change this
var plus_i=0 // no need to change this
// The following block is different. It contains a mainlink without submenus.
// Take care to set the ";;;;" exactly as seen below.
menublock[0]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Test1|main.html|main;" // text and URL of mainlink
menublock[1]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
"Verdana;"+ // font sublinks
"3;"+ // fontsize sublinks
"FFFFFF;"+ // fontcolor sublinks
"0;"+ // fontweight sublinks, 1 means bold, 0 means normal
"Test3|#|;"+ // text|URL|target of mainlink
"submenu 1.1|submenu11.html|main;"+ // text|URL|target of first sublink
"submenu 1.2|submenu12.html|main;" // text|URL|target of second sublink
menublock[2]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
"Verdana;"+ // font sublinks
"3;"+ // fontsize sublinks
"FFFFFF;"+ // fontcolor sublinks
"0;"+ // fontweight sublinks, 1 means bold, 0 means normal
"Test4|#|;"+ // text and URL of first mainlink
"submenu 2.1|submenu21.html|main;"+ // text|URL|target of mainlink
"submenu 2.2|submenu22.html|main;"+ // text|URL|target of first sublink
"submenu 2.3|submenu23.html|main;"+ // text|URL|target of second sublink
"submenu 2.4|submenu24.html|main;"+ // text|URL|target of thirth sublink
"submenu 2.5|submenu25.html|main;" // text|URL|target of fourth sublink
menublock[3]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Kontakt|main.html|main;" // text and URL of mainlink
menublock[4]="Arial;"+ // font mainlink
"2;"+ // fontsize mainlink
"FFFFFF;"+ // fontcolor mainlink
"1;"+ // fontweight mainlink, 1 means bold, 0 means normal
";;;;"+ // leave it empty
"Home|main.html|main;" // text and URL of mainlink
// No need to change anything below
// **********************************************************************************
var menusplit
var urlsplit
var font_weight_main
var font_weight_sub
var font_weight_sub
var minusimg=new Image()
minusimg.src="minus131.gif"
var plusimg=new Image()
plusimg.src="plus131.gif"
var showsubmenus=new Array()
for (i=0;i<=menublock.length-1;i++) {
showsubmenus[i]=-1
}
var plusminusimg=new Array()
for (i=0;i<=menublock.length-1;i++) {
plusminusimg[i]=plusimg.src
}
function openandclose(visi) {
showsubmenus[visi]=(-1)*showsubmenus[visi]
var menucontent=""
if (showsubmenus[visi]==1) {plusminusimg[visi]=minusimg.src}
if (showsubmenus[visi]==-1) {plusminusimg[visi]=plusimg.src}
menucontent+="<table border=0>"
for (i=0;i<=menublock.length-1;i++) {
menusplit=menublock[i].split(";")
urlsplit=menusplit[8].split("|")
if (menusplit[3]==1) {font_weight_main="<b>"}
if (menusplit[3]==0) {font_weight_main=""}
if (menusplit[7]==1) {font_weight_sub="<b>"}
if (menusplit[7]==0) {font_weight_sub=""}
menucontent+="<tr><td>"
if (menusplit[9].length==0) {
menucontent+="</td>"
menucontent+="<td>"
menucontent+=font_weight_main
menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+">"
menucontent+="<font face="+menusplit[0]+" color="+menusplit[2]+" size="+menusplit[1]+">"
menucontent+=urlsplit[0]
menucontent+="</font></a></td></tr>"
plus_i++
}
if (menusplit[9].length!=0) {
var thismainmenu=i+plus_i
menucontent+="<a href='javascriptpenandclose("+i+")'>"
menucontent+="<img src='"+plusminusimg[i]+"' border=0></a></td>"
menucontent+="<td>"
menucontent+=font_weight_main
menucontent+="<a href='javascriptpenandclose("+i+")'>"
menucontent+="<font face="+menusplit[0]+" color="+menusplit[2]+" size="+menusplit[1]+">"
menucontent+=urlsplit[0]
menucontent+="</font></a></td></tr>"
if (showsubmenus[i]==1) {
for (ii=9;ii<=menusplit.length-1;ii++) {
urlsplit=menusplit[ii].split("|")
menucontent+="<tr><td></td><td>"
menucontent+=font_weight_sub
menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+">"
menucontent+="<font face="+menusplit[4]+" color="+menusplit[6]+" size="+menusplit[5]+">"
menucontent+=urlsplit[0]
menucontent+="</font></a></td></tr>"
}
}
}
}
menucontent+="</table>"
if (document.all) {
menu.innerHTML=menucontent
}
if (document.layers) {
document.menu.document.write(menucontent)
document.menu.document.close()
}
}
// - End of JavaScript - -->
</script>
Kommentar