Menu skal starte i en undermenuer?
Jeg har dette menu-script, men vil gerne havde at en undermenu er "on" når man går ind på siden!Er der nogle der kan rette script eller har et som kan dette?
Script:
http://www.viewsource.dk/dhtml/Menus/Displayhide/Displayhide.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>DHTML - Menus - Displayhide</title>
<style TYPE="text/css">
<!--
H3 {font-family: Verdana,Arial,Helvetica;font-size:10pt;font-weight:bold;}
TT{font-family:monospace;}
B I{color:#0000ff;font-size:100%;}
DIV,TD{font-family:Arial,Verdana,Helvetica;font-size:10pt;}
SPAN SMALL{font-size:80%;}
SPAN.times{font-family:Times New Roman,Times,serif;font-size:100%;}
-->
</style>
<script LANGUAGE="JavaScript">
<!--
var bV=parseInt(navigator.appVersion);
NS4=(document.layers)?true:false;
IE4=(document.all)?true:false;
ver4=(NS4 || IE4)?true:false;
if (document.images) {
arImLoad=new Array ("triup.gif");
arImList=new Array ();
for (counter in arImLoad) {
arImList[counter]=new Image();
arImList[counter].src=arImLoad[counter] + ".gif";
}}
function expandIt(){return}
function expandAll(){return}
//-->
</script>
<script LANGUAGE="JavaScript1.2">
<!--
isExpanded=false;
function reDo(){window.location.reload()}
function getIndex(el) {
ind=null;
for (i=0; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.id==el) {
ind=i;
break;
}
}
return ind;
}
function arrange() {
nextY=document.layers[firstInd].pageY + document.layers[firstInd].document.height-10;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY=nextY;
nextY += whichEl.document.height-10;
}
}
}
function initIt(){
if (NS4) {scrollTo(0,pageYOffset-30)
for (i=0; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.id.indexOf("Child") != -1) {
whichEl.visibility="hide";
whichEl.isExpanded=false;
}
}
arrange();
setTimeout("window.onresize=reDo",1000)
}
else {
tempColl=document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
if (tempColl(i).className == "child") {
tempColl(i).style.display="none";
tempColl(i).isExpanded=false;
}
}
}
}
function expandIt(el) {
if (!ver4) return;
if (IE4) {expandIE(el)} else {expandNS(el)}
}
function expandIE(el) {
whichEl=eval(el + "Child");
whichIm=event.srcElement;
if (whichEl.style.display == "none") {
whichEl.style.display="block";
whichEl.isExpanded=true;
whichIm.src="triup.gif";
}
else {
whichEl.style.display="none";
whichEl.isExpanded=false;
whichIm.src="tridown.gif";
}
}
function expandNS(el) {
whichEl=eval("document." + el + "Child");
whichIm=eval("document." + el + "Parent.document.images['imEx']");
if (whichEl.visibility == "hide") {
whichEl.visibility="show";
whichEl.isExpanded=true;
whichIm.src="triup.gif";
}
else {
whichEl.visibility="hide";
whichEl.isExpanded=false;
whichIm.src="tridown.gif";
}
arrange();
}
function showAll() {
for (i=firstInd; i<document.layers.length; i++) {
whichEl=document.layers[i];
whichEl.visibility="show";
}
}
function expandAll(isBot) {
newSrc=(isExpanded)?"images/triDown.gif":"images/triUp.gif";
if (NS4) {
document.images["imEx"].src=newSrc;
for (i=firstInd; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.id.indexOf("Parent") != -1) {
whichEl.document.images["imEx"].src=newSrc;
}
if (whichEl.id.indexOf("Child") != -1) {
whichEl.visibility=(isExpanded)?"hide":"show";
whichEl.isExpanded=(isExpanded)?false:true;
}
}
arrange();
if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
}
else {
divColl=document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
if (divColl(i).className == "child") {
divColl(i).style.display=(isExpanded)?"none":"block";
divColl(i).isExpanded=(isExpanded)?false:true;
}
}
imColl=document.images.item("imEx");
for (i=0; i<imColl.length; i++) {
imColl(i).src=newSrc;
}
}
isExpanded=!isExpanded;
}
with (document) {
write("<STYLE TYPE='text/css'>");
write(".parent {");
if (NS4) {write("position:absolute; visibility:hidden;")};
if (IE4) {write("margin-top:-10;")};
write("margin-left:35;");
write("color:#006");
write("}");
write(".child {");
if (NS4) {write("position:absolute; visibility:hidden;")};
if (IE4) {write("display:none;")};
write("margin-left:50;");
write("}");
write(".other {");
if (NS4) {write("position:absolute; visibility:hidden;")};
write("margin-left:25;");
write("}");
write("</STYLE>");
}
function linkIt(whichEl, whichHref) {
lay=(NS4)?eval("document."+whichEl+"Child"):eval(whichEl+"Child");
if (!lay.isExpanded) expandIt(whichEl);
nlay=(NS4)?lay.document.images[whichHref]:document.images[whichHref];
if (NS4){
sY=nlay.y+lay.pageY-20
window.scrollTo(0,sY);
}else{nlay.scrollIntoView();scroll(0,document.body.scrollTop-20);
//alert(nlay.parentElement.tagName);
nlay.parentElement.style.backgroundColor="#FF99FF";setTimeout("nlay.parentElement.style.backgroundColor='white'",1000);}
}
window.onload=initIt;
//-->
</script>
<style type="text/css">
TD.format
{
COLOR: blue;
FONT-FAMILY: Verdana;
FONT-SIZE: 15px;
FONT-WEIGHT: bolder
}
TD.format A:active
{
COLOR: red;
TEXT-DECORATION: none
}
TD.format A:link
{
COLOR: blue;
TEXT-DECORATION: none
}
TD.format A:visited
{
COLOR: blue;
TEXT-DECORATION: none
}
TD.format A:hover
{
COLOR: red;
TEXT-DECORATION: none
}
</style>
</head>
<body bgcolor="#003399">
<table bgColor="#000080" border="1" borderColorDark="#0000ff" borderColorLight="#000000" cellPadding="10" cellSpacing="5" width="100%" height="98%">
<tr>
<td height="1%"><table border="0" cellPadding="0" cellSpacing="0" width="100%">
<tr>
<td class="format"><IMG align=absMiddle alt="Author of this Script" border=0 height=16 src="../../../images/doc.gif" width=16 > <a href="http://www.webrefernce.com">Webrefernce</a></td>
<td class="format" align="right"> DHTML - Menus - Displayhide</td>
</tr>
</table>
</td>
</tr>
<tr>
<td vAlign="center" height="80%"><div align="center"><center><table border="0" cellPadding="0" cellSpacing="0" class="format" width="500">
<tr>
<td bgcolor=white align="left" vAlign="top" class="format" width="500">
<br><br>
<script LANGUAGE="JavaScript">
<!--
if(!ver4)document.write("<BLOCKQUOTE>");
//-->
</script>
<div ID="elOneParent" CLASS="parent"><h3><a HREF="#" onClick="expandIt('elOne'); return false"><img NAME="imEx" SRC="tridown.gif" BORDER="0" ALT="Expand/Collapse Item" WIDTH="12" HEIGHT="12"></a> DHTML Sites</h3></div>
<div ID="elOneChild" CLASS="child"> <a HREF="http://www.viewsource.dk">ViewSource.dk</a><br><br> <a href="http://www.webreference.com">Webreference.com</a><br><br> <a HREF="http://www.24fun.ch">24 Fun</a><br><br> <a HREF="http://dynamicdrive.com">Dynamic Drive</a></div><br>
<div ID="elTwoParent" CLASS="parent"><h3><a href="#" onclick="expandIt('elTwo'); return false"><img alt="Expand/Collapse Item" border="0" name="imEx" src="tridown.gif" WIDTH="12" HEIGHT="12"></a> JavaScript Sites</h3></div>
<div ID="elTwoChild" CLASS="child"> <a HREF="http://www.viewsource.dk">ViewSource.dk</a><br></div><br>
<div ID="elThreeParent" CLASS="parent"><h3><a href="#" onclick="expandIt('elThree'); return false"><img name="imEx" src="tridown.gif" border="0" alt="Expand/Collapse Item" WIDTH="12" HEIGHT="12"></a> <strong> Java Sites</h3></div>
<div ID="elThreeChild" CLASS="child"> <a HREF="http://www.viewsource.dk">ViewSource.dk</a><br></div>
<br><br>
</td>
</tr>
</table></center></div></td></tr>
<tr>
<td height="1%"><table border="0" cellPadding="0" cellSpacing="0" width="100%">
<tr>
<td class="format" align="middle">FreeWare</td>
</tr>
</table>
</td>
</tr></table>
</body>
</html>
