View Full Version : How to create "open new window" code within a Javascript menu bar?

08-27-2008, 08:16 PM

I've read quite a bit about how to use Javascript to open a new window within HTML code, but I think the issue I'm experiencing is slightly different.

What I'd like to do is have some (but not all) choices within a menu bar open their links in a new window when clicked on, but I'm confused about how to do that since the menu bar itself is already coded in Javascript.

Here's the link to the menu bar, so you can see what I mean: http://roddy.com/headertest.asp.

As an example, if you rollover the "Training" button, a few choices appear. If someone clicks on "View all upcoming Roddy.com events statewide!" I'd like that link to open in a new window. The rest of the links should still open within the main window, however.

The current Javascript code for that portion of the menu is below:

function mmLoadMenus() {
if (window.mm_menu_1103164709_0) return;
window.mm_menu_1103164709_0 = new Menu("root",300,16,"Arial, Helvetica, sans-serif",11,"#0C2C4D","#FFFFFF","#B4CCE0","#9B0000","left","middle",3,0,1000,-5,7,true,true,true,2,true,true);
mm_menu_1103164709_0.addMenuItem("Welcome Letter","location='Welcome.asp'");
mm_menu_1103164709_0.addMenuItem("Investor Workshops","location='Workshops.asp'");
mm_menu_1103164709_0.addMenuItem("The RealtorŪ Series","location='RealtorSeries.asp'");
mm_menu_1103164709_0.addMenuItem("All Event Annual Pass","location='AnnualPass.asp'");
mm_menu_1103164709_0.addMenuItem("View all upcoming Roddy.com events statewide!","location='allEvents.asp'");

Any help you can provide would be great!


P.S. I did not create the above code and am relatively new to Javascript coding. So feel free to explain things to me like you would to a 2 year old. I would appreciate it, actually. Thanks!