The horizontal menu requires loading one JavaScript file and one stylesheet (.css file). They can be found in the distribution archive as “src/hmenu.js” and “src/skin-*.css”. You can load any skin file that you like, or you can write your own. The above code assumes that you're using the Windows XP skin.
Before loading the script, it is important to declare the URL, absolute to your pages, where your menu instalation can be found. Here is an example of the HTML file header:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- load the menu stylesheet --> <style type="text/css"> @import url("/hmenu/skin-xp.css"); </style> <!-- declare the menu location --> <script type="text/javascript"> _dynarch_menu_url = "/hmenu/"; </script> <!-- load the menu program file --> <script type="text/javascript" src="/hmenu/hmenu.js"></script> <!-- [ ... ] your HEAD declarations here --> </head> <body onload="DynarchMenu.setup('menu');">
The above code assumes that you placed the menu files under the “/hmenu/” directory in your document root, as described in the files section.
Note a call to DynarchMenu.setup in the body.onload event handler. This is about the only JavaScript code that you need to write in order to generate a menu. The next section describes how you can generate a menu.