DHTML Lab: Cross-Browser Hierarchical Menus; The Complete Code 1/3 | WebReference

DHTML Lab: Cross-Browser Hierarchical Menus; The Complete Code 1/3


Logo

  Cross-Browser Hierarchical Menus
  SPECIAL EDITION; the director's cut 1/3

The Page HTML

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
   NS4 = (document.layers) ? 1 : 0;
   IE4 = (document.all) ? 1 : 0;
  ver4 = (NS4 || IE4) ? 1 : 0;   
 isMac = (navigator.appVersion.indexOf("Mac") != -1) ? 1 : 0;
isMenu = (NS4 || (IE4 && !isMac)) ? 1 : 0;
   function popUp(){return};
   function popDown(){return};
   if (!ver4) event = null;
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
    if (isMenu) {
        menuWidth = 120;
        borWid = 2;
        fntCol = "black";
        fntSiz = "12px";
        fntWgh = "normal";
        fntSty = "normal";
        fntFam = "sans-serif";
        borCol = "black"
        borSty = "outset";
        linHgt = "normal";
        backCol = "#DDDDDD";
        overCol = "yellow";
        overFnt = "blue";
        imgSrc = "triangle.gif";
        imgSiz = 10;
        childOverlap = 50;
        childOffset = 3;
        perCentOver = null;
        secondsVisible = .5;
    }
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
if (isMenu) {
document.write("<SCRIPT LANGUAGE='JavaScript1.2' SRC='hierArrays.js'><\/SCRIPT>");
document.write("<SCRIPT LANGUAGE='JavaScript1.2' SRC='hierMenus.js'><\/SCRIPT>");
}
//-->
</SCRIPT>
</HEAD>
<BODY>
.
.
.
<A HREF="default URL"
      onMouseOver = "popUp('1st menuNameString',event)"
      onMouseOut = "popDown('1st menuNameString')">
         Display HTML for Link</A>
<A HREF="default URL"
      onMouseOver="popUp('2nd menuNameString',event)"
      onMouseOut="popDown('2nd menuNameString')">
         Display HTML for Link</A>
.
.
.
</BODY>
</HTML>

Next, let's review the external JavaScript array file.


Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: Feb. 27, 1998
Revised: Feb. 27, 1998

URL: https://www.webreference.com/dhtml/column15/allCode1.html