I copied the bulk of this from the MS website, I've been looking for a menu interface for my site. I've modified this enough that it doesnt display the list expanded, but, then when you click on an item, it doesnt expand back out.
I program in VB, but this script is driving me crazy. Some of the menu item have been unchanged since I copied it.
Thanks (very much) in advance,
Dale
<HEAD>
<SCRIPT>
function init()
{
var coll = document.all.tags("LI"
if (coll != null)
{
for (i=0; i < coll.length; i++)
if (coll.className == "COLLAPSING"
{
coll.style.listStyleImage = "url(' coll.style.display='';
}
else if (coll.className == "SINGLE"
{
coll.style.listStyleImage = "url(' coll.style.display='';
}
else
{
coll.style.listStyleImage = "url(' coll.style.display = 'none';
}
}
}
function expandCollapse ()
{
oSource = event.srcElement;
if (oSource.className != "COLLAPSING"
{
event.srcElement.style.listStyleImage = "url(' event.srcElement.style.display='';
return;
}
else
{
event.srcElement.style.listStyleImage = "url(' event.srcElement.style.display='';
}
oChild = document.all(oSource.getAttribute('CHILD', false));
if (oChild.style.display=='none')
{
oChild.style.display='';
event.srcElement.style.listStyleImage='url( }
else
{
oChild.style.display='none';
event.srcElement.style.listStyleImage='url( }
}
function doMouseOver()
{
oSource = event.srcElement;
if ((oSource.className != "COLLAPSING" && (oSource.tagName != "A")
return;
oSource.style.cursor = "hand";
oSource.style.color = "red";
}
function doMouseOut()
{
oSource = event.srcElement;
if ((oSource.className != "COLLAPSING" && (oSource.tagName != "A")
return;
oSource.style.cursor = "";
oSource.style.color = "black";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF"
onload="init()"
onmouseover="doMouseOver()"
onmouseout="doMouseOut()"
onclick="expandCollapse()" >
<FONT SIZE=1 FACE="Verdana,Arial,Helvetica">
<UL>
<LI CLASS="COLLAPSING" CHILD="Topics1">HTML Authoring</LI>
<UL ID="Topics1">
<LI><A HREF="/workshop/author/default.asp">Beginner's Guide</A></LI>
<LI><A HREF="/workshop/author/default.asp">IE4.0 Authoring Tips</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Coding Tips</A></LI>
<LI><A HREF="/workshop/author/default.asp">Table Cell Backgrounds</A></LI>
<LI><A HREF="/workshop/author/default.asp">Drop Caps</A></LI>
<LI><A HREF="/workshop/author/default.asp">Quote Server</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Wizard</A></LI>
<LI><A HREF="/workshop/author/default.asp">Dr. HTML</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Coding FAQ for Internet Explorer</A></LI>
<LI><A HREF="/workshop/author/default.asp">SGML DTD for Internet Explorer 3.0 Markup</A></LI>
<LI><A HREF="/workshop/author/default.asp">Authoring Basics</A></LI>
<LI><A HREF="/workshop/author/default.asp">Authoring Effective Pages</A></LI>
<LI><A HREF="/workshop/author/default.asp">Designing Efficient Pages</A></LI>
<LI><A HREF="/workshop/author/default.asp">Using Frames</A></LI>
</UL>
<LI CLASS="SINGLE"><A HREF="/workshop/author/default.asp">HTML Help Authoring</A></LI>
<LI CLASS="COLLAPSING" CHILD="Topics2">HTML References</LI>
<UL ID="Topics2">
<LI><A HREF="/workshop/author/default.htm">Elements</A></LI>
<LI><A HREF="/workshop/author/default.htm">Character Sets</A></LI>
</UL>
<LI CLASS="COLLAPSING" CHILD="Topics3">HTML Applications (HTA)</LI>
<UL ID="Topics3">
<LI><A HREF="/workshop/author/default.htm">Overview</A></LI>
<LI><A HREF="/workshop/author/default.htm">Reference</A></LI>
</UL>
</UL>
</FONT>
</BODY>
I program in VB, but this script is driving me crazy. Some of the menu item have been unchanged since I copied it.
Thanks (very much) in advance,
Dale
<HEAD>
<SCRIPT>
function init()
{
var coll = document.all.tags("LI"
if (coll != null)
{
for (i=0; i < coll.length; i++)
if (coll.className == "COLLAPSING"
{
coll.style.listStyleImage = "url(' coll.style.display='';
}
else if (coll.className == "SINGLE"
{
coll.style.listStyleImage = "url(' coll.style.display='';
}
else
{
coll.style.listStyleImage = "url(' coll.style.display = 'none';
}
}
}
function expandCollapse ()
{
oSource = event.srcElement;
if (oSource.className != "COLLAPSING"
{
event.srcElement.style.listStyleImage = "url(' event.srcElement.style.display='';
return;
}
else
{
event.srcElement.style.listStyleImage = "url(' event.srcElement.style.display='';
}
oChild = document.all(oSource.getAttribute('CHILD', false));
if (oChild.style.display=='none')
{
oChild.style.display='';
event.srcElement.style.listStyleImage='url( }
else
{
oChild.style.display='none';
event.srcElement.style.listStyleImage='url( }
}
function doMouseOver()
{
oSource = event.srcElement;
if ((oSource.className != "COLLAPSING" && (oSource.tagName != "A")
return;
oSource.style.cursor = "hand";
oSource.style.color = "red";
}
function doMouseOut()
{
oSource = event.srcElement;
if ((oSource.className != "COLLAPSING" && (oSource.tagName != "A")
return;
oSource.style.cursor = "";
oSource.style.color = "black";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF"
onload="init()"
onmouseover="doMouseOver()"
onmouseout="doMouseOut()"
onclick="expandCollapse()" >
<FONT SIZE=1 FACE="Verdana,Arial,Helvetica">
<UL>
<LI CLASS="COLLAPSING" CHILD="Topics1">HTML Authoring</LI>
<UL ID="Topics1">
<LI><A HREF="/workshop/author/default.asp">Beginner's Guide</A></LI>
<LI><A HREF="/workshop/author/default.asp">IE4.0 Authoring Tips</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Coding Tips</A></LI>
<LI><A HREF="/workshop/author/default.asp">Table Cell Backgrounds</A></LI>
<LI><A HREF="/workshop/author/default.asp">Drop Caps</A></LI>
<LI><A HREF="/workshop/author/default.asp">Quote Server</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Wizard</A></LI>
<LI><A HREF="/workshop/author/default.asp">Dr. HTML</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Coding FAQ for Internet Explorer</A></LI>
<LI><A HREF="/workshop/author/default.asp">SGML DTD for Internet Explorer 3.0 Markup</A></LI>
<LI><A HREF="/workshop/author/default.asp">Authoring Basics</A></LI>
<LI><A HREF="/workshop/author/default.asp">Authoring Effective Pages</A></LI>
<LI><A HREF="/workshop/author/default.asp">Designing Efficient Pages</A></LI>
<LI><A HREF="/workshop/author/default.asp">Using Frames</A></LI>
</UL>
<LI CLASS="SINGLE"><A HREF="/workshop/author/default.asp">HTML Help Authoring</A></LI>
<LI CLASS="COLLAPSING" CHILD="Topics2">HTML References</LI>
<UL ID="Topics2">
<LI><A HREF="/workshop/author/default.htm">Elements</A></LI>
<LI><A HREF="/workshop/author/default.htm">Character Sets</A></LI>
</UL>
<LI CLASS="COLLAPSING" CHILD="Topics3">HTML Applications (HTA)</LI>
<UL ID="Topics3">
<LI><A HREF="/workshop/author/default.htm">Overview</A></LI>
<LI><A HREF="/workshop/author/default.htm">Reference</A></LI>
</UL>
</UL>
</FONT>
</BODY>