NN 4, IE 4
You want the top of every page in a deep and highly structured site to display "bread crumb trails" of where the user is within a hierarchy path.
Customize and apply the trail.js library (shown
in Example 10-5 in the Discussion) to a location on
your pages where the menu trail is to appear. Figure 10-3 shows one example on a page that includes the
following HTML and script call to the
) function in the library:
Figure 10-3. A "bread crumb trail" menu
This recipe assumes that your web documents on the server are structured in a directory hierarchy that matches the conceptual organization of the site. For example:
index.html (home at the root directory) catalog/ index.html (intro to catalog and links to categories) economy/ [many .html pages for this category] deluxe/ [many .html pages for this category] export/ [many .html pages for this category] support/ index.html (intro to support and links to categories) contact.html faq/ downloads/ manuals/
Example 10-5 shows the code for the trail.js library, which should be linked into every page of the site that fits within the structural hierarchy.
Example 10-5. The trail.js library ...