DHTML Lab: Hierarchical Menus Ver. 2 - Addendum (v2.1) | 3
Hierarchical Menus Ver. 2 - Addendum (v2.1)
| |||
Click the links above to reveal menus. Click the button above for frame-related mods. |
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","https://www.webreference.com/experts/",1, "Contents","https://www.webreference.com/index2.html",1, "Services","https://www.webreference.com/index2.html",1, "About","https://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:[email protected]",0, "Gopher","gopher://gopher.tc.umn.edu:70/",0, "FTP","ftp://sunsite.unc.edu/",0, "View Source", "view-source:https://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
All Rights Reserved. Legal Notices.Created: June 29, 1998
Revised: June 29, 1998
URL: https://www.webreference.com/dhtml/column20/addendum/col20add3.html