DHTML Lab: Hierarchical Menus Version 3; The Complete Code 1/3 | WebReference

DHTML Lab: Hierarchical Menus Version 3; The Complete Code 1/3


Logo

  Hierarchical Menus Version 3
  SPECIAL EDITION; the director's cut 1/3

The FRAMESET document

If you choose to have hierarchical menus in a frameset, create a frameset as you normally would.

It is highly recommended that you name your navigation frame nav and the main frame main.

<HTML>
<HEAD>
</HEAD>
<FRAMESET COLS="145,*" FRAMEBORDER=0 BORDER=0>
    <FRAME NAME="nav"
           SRC="yourNAVpage.html"
           SCROLLING=NO MARGINHEIGHT=0 MARGINWIDTH=0>
    <FRAME NAME="main"
           SRC="yourFirstMainPage.html">
</FRAMESET>
</HTML>

The In-Page Script/HTML

If you are using a frameset, this HTML and script should be included in your navigation page.
If using a full-window, insert in the page that displays the menus.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
   NS4 = (document.layers);
   IE4 = (document.all);
  ver4 = (NS4 || IE4);   
 isMac = (navigator.appVersion.indexOf("Mac") != -1);
isMenu = (NS4 || (IE4 && !isMac));
function popUp(){return};
function popDown(){return};
function startIt(){return};
if (!ver4) event = null;
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
if (isMenu) {
    menuVersion = 3;
    
    menuWidth = 120;
    childOverlap = 50;
    childOffset = 5;
    perCentOver = null;
    secondsVisible = .5;
    
    fntCol = "blue";
    fntSiz = "10";
    fntBold = false;
    fntItal = false;
    fntFam = "sans-serif";
    
    backCol = "#DDDDDD";
    overCol = "#FFCCCC";
    overFnt = "purple";
    
    borWid = 2;
    borCol = "black";
    borSty = "solid";
    itemPad = 3;
    
    imgSrc = "tri.gif";
    imgSiz = 10;
    
    separator = 1;
    separatorCol = "red";
    
    isFrames = false;
    navFrLoc = "left";
    mainFrName = "main";
    
    keepHilite = true; 
    NSfontOver = true;
    clickStart = true;
    clickKill = true;
    
    showVisited = "yellow";
}
//-->
</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>
.
. other HTML
.
<A HREF="/"
   onMouseOver="popUp('elMenu1',event)"
   onMouseOut="popDown('elMenu1')">Webreference</A>
<A HREF="/index2.html"
   onMouseOver="popUp('elMenu2',event)"
   onMouseOut="popDown('elMenu2')">Contents</A>
.
. other HTML
.
</BODY>

The next page lists an example of menu arrays.


Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: Sept. 03, 1998
Revised: Sept. 03, 1998

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