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
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

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

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