| home / web / dev / menus / future | ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
|
Universal Related Popup MenusActiveXNick Heinle's May 2, 1997 column in Web Coder demonstrates nicely how to use ActiveX to create related menus for Explorer 3+ users. We chose not to incorporate ActiveX in this version because we wanted stability, and had to hard code the initial menus. Notice that this code has the same resize problem we discussed earlier. In VBscript, option text is read only so this wasn't an option, but in ActiveX option text is read/write. The ActiveX popup control needs to be dynamically written to use with a JavaScript version, so our stability criteria precluded this. We could, however, use the "hidden frame" trick to direct users to browser-optimized pages, one of which could be an Explorer/ActiveX page (see Cool Central for an example of the hidden frame trick). WYSIWYG - If we (or one of you intrepid readers) could figure out a way to avoid the resize problems we found with document.writes, we could include the ActiveX code. Any solutions? If you find one, we'll mention your name in the next version of this article and the home page's source code. Features/Version of JavaScript Supported vs. Browser TypeBrute force method - A better way to optimize the code for different browsers (i.e., type=n3) is to check for feature support or the version of JavaScript support: Thanks to Peter Belesis of Dynamic HTML Lab for this elegant solution. Fourth Related MenuFor the more adventurous among you, consider adding a fourth related menu. You can extend the techniques we used in our three related menus (use a simulated 4-D array) to control a fourth or even fifth menu. Our site is not that deep, hierarchically speaking, so we felt that this wasn't necessary. For more levels, or if you want to trigger menus off of graphics or links, try Peter Belesis' popular hierarchical menus that have an infinite number of levels. FramesThe CGI redirect does not jump out of a frame. In JavaScript this is easy, just tack on a top to the location property (top.location = ... in jumpPage) and you're done. To force your redirect script to jump out of a frame (and fill the current window) use TARGET="_top" in the FORM tag.
onSubmit="return false" TARGET="_top"> HTML 4 Nested MenusThe new HTML spec allows one-level deep nested pull-down menus with the new option group (optgroup) tag. Unfortunately, current browsers and the current version of Gecko don't yet support this new feature. See Webreview.com, Dec. 18, 1998 for details. Further ImprovementsThe current version of the code has been tweaked and refined since Netscape 3.0b1 came out but there's always room for improvement. If you think of any, especially those that make the code more generic or smaller, let me know and I'll give you credit in this article. |
Comments are welcome
Created: Mar. 10, 1997
Revised: Feb. 12, 1999
URL: http://webreference.com/dev/menus/future.html