Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Building the Imperfect Beast: Part 1 (menus.js)

January 19, 1999

The content of each menu will be contained within a discrete layer. Ultimately, all of these layers will reside within the spawned window which will behave as the pop-up menu. It's important to remember that the content of these menus must be easily modified by a non-programmer, a person at the client's end who can maintain these pop up menus in the future. We begin, then, by creating a file containing the hyperlinks for the menus. This file merely creates an array for each topic. Each array contains the hyperlink data in pairs -- link text followed by link URL. We've named this file menus.js.

menus.js
annuities_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html"
)

auto_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

business_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html",
"Link 4","http://link4.html"
)

health_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

home_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

life_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

personal_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

ratings_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

state_links=new Array(
"Link 1","http://link1.html"
)

toolbox_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

features_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html"
)

help_links=new Array(
"Link 1","http://link1.html",
"Link 2","http://link2.html",
"Link 3","http://link3.html"
)

sponsor_links=new Array(
"Link 1","http://link1.html"
)

Each array can essentially hold any number of links, but it is quite crucial that proper JavaScript syntax be adhered to. Specifically, that means a comma between each entry except after the final entry of the array. Additionally, each entry must be contained within quotation marks, and we've chosen to use double-quotation marks here. In a case where the link text itself might need to contain a quotation mark, such as Learning the "new" math, one must use an escaped double-quotation mark (\") within the link text. In other words: "Learning the \"new\" math".

Isolating the menu contents within the discrete menus.js file will benefit the client, who will not have to wade through heavy program code to modify the menus.

All of the layout of the menus, meaning the layers, and some of the control, meaning the menu behavior, will be contained within a single file which will be loaded into the spawned menu window, a file named popups.html. The remaining code which spawns the menu window and pulls its strings will be embedded into the client's original page(s). We continue, then, by looking at the menu window itself, popups.html.

The Great Layers Bug and Dead End Syndrome
DHTML Pop-Up Menus: A Parable of Triumph and Loss (Based on a True Story)
Building the Imperfect Beast: Part 2 (popups.html)


Up to => Home / Authoring / DHTML / Menus




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers