New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact


<script language="JavaScript" src="navcond.js"></script>
<script language="JavaScript">

Top Navigational Bar II (By Mike Hall)
Last updated: 00/05/08
Permission granted to to include script in archive
For this and 100's more DHTML scripts, visit

var myNavBar1 = new NavBar(0);
var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub category width in pixels)
//add more menus simply by adding more "blocks" of same code below

dhtmlMenu = new NavBarMenu(100, 0);
dhtmlMenu.addItem(new NavBarMenuItem("Home", ""));

dhtmlMenu = new NavBarMenu(100, 120);
dhtmlMenu.addItem(new NavBarMenuItem("News", ""));
dhtmlMenu.addItem(new NavBarMenuItem("CNN", ""));
dhtmlMenu.addItem(new NavBarMenuItem("MSNBC", ""));
dhtmlMenu.addItem(new NavBarMenuItem("ABCNews", ""));

dhtmlMenu = new NavBarMenu(110, 120);
dhtmlMenu.addItem(new NavBarMenuItem("Technology", ""));
dhtmlMenu.addItem(new NavBarMenuItem("", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Techweb", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Wired", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Dynamic Drive", ""));

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Search", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Yahoo", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Alta Vista", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Infoseek", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Excite", ""));
dhtmlMenu.addItem(new NavBarMenuItem("HotBot", ""));

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Webmaster", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Dynamic Drive", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Website Abstraction", ""));
dhtmlMenu.addItem(new NavBarMenuItem("", ""));
dhtmlMenu.addItem(new NavBarMenuItem("BrainJar", ""));

//set menu colors
myNavBar1.setColors("#000000", "#000000", "#C0C0C0", "#ffffff", "#666666", "#000000", "#cccccc", "#ffffff", "#000080")

//uncomment below line to center the menu (valid values are "left", "center", and "right"

var fullWidth;

function init() {

// Get width of window, need to account for scrollbar width in Netscape.

fullWidth = getWindowWidth()
- (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);



<body onload="init()">