I have a javascript rollover menu that is beinf generate dynamically but I have trouble having the rollover portion of the menu "roll out" (i mean roll out of site - disappear) when the cursor is nowhere near the target. could someone look at this snippet of code and let me know what i am doing wrong? what sort of funtion do i need and where can i put it? thanks for any help I really appreciate it!
//==================================================
for (z=0; z< subitemcount; z++) {
menu.document.writeln("<table ID=" + subitems[z] + " border=\"1\" STYLE='position:absolute; top:30px; left:0px; visibility:hidden'>"
;
menu.document.writeln("<tr>"
;
targetNumber = subitems[z];
targetNumberArray = targetNumber.split("."
;
targetLevel = targetNumberArray.length-1;
for (i=1; i<tocTab.length; i++) {
thisNumber = tocTab[0];
thisNumArray = thisNumber.split("."
;
thisLevel = thisNumArray.length-1;
isOnPath = true;
for (j=0; j<=targetLevel; j++) {
isOnPath = isOnPath && (thisNumArray[j] == targetNumberArray[j]);
}
menuDisplay = isOnPath && ((targetLevel+1) == thisLevel);
} // End of loop over the tocTab
var scrollY=0, addScroll=tocScroll;
for (i=1; i<tocTab.length; i++) {
if (menuDisplay) {
thisNumber = tocTab[0];
thisNumArray = thisNumber.split("."
;
thisLevel = thisNumArray.length-1;
isCurrent = (i == currentIndex);
// If the scoll parameter is set true than increment the scrollY value:
if (addScroll) scrollY+=((thisLevel<2)?mdi:sml)*25;
if (isCurrent) addScroll=false;
// thisTextColor = the text color of this heading
if (noLink)
thisTextColor = (thisNumber==oldCurrentNumber) ? currentColor
(thisNumber==oldLastVisitNumber) ? lastVisitColor:normalColor);
else thisTextColor = (thisNumber==currentNumber) ? currentColor
(thisNumber==oldCurrentNumber) ? lastVisitColor:normalColor);
// ...then the hading symbol and the heading text each with a javaScript link caling just this function reDisplay again:
menu.document.writeln("<td>"
;
menu.document.writeln("<a href=\"javaScript:history.go(0)\" onMouseOver=\"parent.displaySubMenu('" + thisNumber + "');\" onMouseDown=\"parent.reDisplay('" + thisNumber + "'," + "1" + "," + tocLinks[1] + ",event)\" style=\"font-family: " + fontLines + "; alert();" + ((thisLevel<=mLevel)?"font-weight:bold":""
+ "; font-size:" + ((thisLevel<=mLevel)?mdi:sml) + "em; color: " + thisTextColor + "; text-decoration:none\">" + tocTab[1] + "</a>"
;
menu.document.writeln("</td>"
;
}
} // End of loop over the tocTab
}
menu.document.writeln("</tr>"
;
menu.document.writeln("</table>"
;
//==============================================
menu.document.writeln("</body></html>"
;
menu.document.close();
// ***************************************
// Closing the ToC document, scrolling its frame window and displaying new content in the content frame or in the top window if required
// ***************************************
// Updating the global variables oldCurrentNumber and oldLastVisitNumber. See above for its definition
if (!noLink) {
oldLastVisitNumber = oldCurrentNumber;
oldCurrentNumber = currentNumber;
}
// Scrolling the ToC if required
if (tocScroll) toc.scroll(0,scrollY);
// Setting the top or content window's location if required
if (theHref)
if (theTarget=="top"
top.location.href = theHref;
else if (theTarget=="parent"
parent.location.href = theHref;
else if (theTarget=="blank"
open(theHref,""
;
else content.location.href = theHref;
}
//==================================================
for (z=0; z< subitemcount; z++) {
menu.document.writeln("<table ID=" + subitems[z] + " border=\"1\" STYLE='position:absolute; top:30px; left:0px; visibility:hidden'>"
menu.document.writeln("<tr>"
targetNumber = subitems[z];
targetNumberArray = targetNumber.split("."
targetLevel = targetNumberArray.length-1;
for (i=1; i<tocTab.length; i++) {
thisNumber = tocTab[0];
thisNumArray = thisNumber.split("."
thisLevel = thisNumArray.length-1;
isOnPath = true;
for (j=0; j<=targetLevel; j++) {
isOnPath = isOnPath && (thisNumArray[j] == targetNumberArray[j]);
}
menuDisplay = isOnPath && ((targetLevel+1) == thisLevel);
} // End of loop over the tocTab
var scrollY=0, addScroll=tocScroll;
for (i=1; i<tocTab.length; i++) {
if (menuDisplay) {
thisNumber = tocTab[0];
thisNumArray = thisNumber.split("."
thisLevel = thisNumArray.length-1;
isCurrent = (i == currentIndex);
// If the scoll parameter is set true than increment the scrollY value:
if (addScroll) scrollY+=((thisLevel<2)?mdi:sml)*25;
if (isCurrent) addScroll=false;
// thisTextColor = the text color of this heading
if (noLink)
thisTextColor = (thisNumber==oldCurrentNumber) ? currentColor
else thisTextColor = (thisNumber==currentNumber) ? currentColor
// ...then the hading symbol and the heading text each with a javaScript link caling just this function reDisplay again:
menu.document.writeln("<td>"
menu.document.writeln("<a href=\"javaScript:history.go(0)\" onMouseOver=\"parent.displaySubMenu('" + thisNumber + "');\" onMouseDown=\"parent.reDisplay('" + thisNumber + "'," + "1" + "," + tocLinks[1] + ",event)\" style=\"font-family: " + fontLines + "; alert();" + ((thisLevel<=mLevel)?"font-weight:bold":""
menu.document.writeln("</td>"
}
} // End of loop over the tocTab
}
menu.document.writeln("</tr>"
menu.document.writeln("</table>"
//==============================================
menu.document.writeln("</body></html>"
menu.document.close();
// ***************************************
// Closing the ToC document, scrolling its frame window and displaying new content in the content frame or in the top window if required
// ***************************************
// Updating the global variables oldCurrentNumber and oldLastVisitNumber. See above for its definition
if (!noLink) {
oldLastVisitNumber = oldCurrentNumber;
oldCurrentNumber = currentNumber;
}
// Scrolling the ToC if required
if (tocScroll) toc.scroll(0,scrollY);
// Setting the top or content window's location if required
if (theHref)
if (theTarget=="top"
else if (theTarget=="parent"
else if (theTarget=="blank"
else content.location.href = theHref;
}