spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / dhtml / column20 / addendum

Logo

Hierarchical Menus Ver. 2 - Addendum (v2.1)
additional features

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Other Menu URLs

Script URLs

Click the links above to reveal menus.

Click the button above for frame-related mods.

Menu Animated GIF
Animated GIF demonstrating heirarchical menus for non-DHTML browsers.

Can't See the Forest...

Many queries revolve around associating a different action with the linkIt() function, which presently has this syntax:

function linkIt() {
    menuLoc.location.href = this.linkText;
}

The linkText property for every item represents the second array element in each group of three defined in hierArrays.js. In the following, the purple elements become linkText properties:

arMenu1 = new Array(
"Experts","http://www.webreference.com/experts/",1,
"Contents","http://www.webreference.com/index2.html",1,
"Services","http://www.webreference.com/index2.html",1,
"About","http://www.webreference.com/about.html",0
)

They are simple http: URLs. We could, therefore, use other valid URLs in their place. The first menu in the left column is created from this array:

arMenu1 = new Array(
"MailTo","mailto:pbel@foo.bar",0,
"Gopher","gopher://gopher.tc.umn.edu:70/",0,
"FTP","ftp://sunsite.unc.edu/",0,
"View Source",
 "view-source:http://www.webreference.com/dhtml/column20/addendum/",0
)

That's all we have to do. Since the JavaScript location.href is identical to the HTML HREF=, any URL that can be included as a value of HREF= is valid.

Try the menu item links. You'll agree that nothing could be more straightforward. It truly is a case of "couldn't see the forest for the trees."

Almost as easy is the inclusion of javascript: URLs to execute script statements.


Produced by Peter Belesis and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

All Rights Reserved. Legal Notices.
Created: June 29, 1998
Revised: June 29, 1998

URL: http://www.webreference.com/dhtml/column20/addendum/col20add3.html