PDA

View Full Version : Adding another pop up drop down.


florida
12-13-2002, 05:31 PM
My Drop down pop up menu works fine for the "First" Link but cant seem to figure out how to get my "Second" Link to also have its own pop up Drop down menu.

Here is the part where I add pop up drop downs and it only works on the first dont know how to get the "Second" one to also have drop down pop ups.

menuContent = new Array ();

menuContent [1] = new Array (
-1,
-1,
120,
-1, // x coordinate (absolute) of left corner of this menu list, -1 if the coordinate is defined from parent x-coordinate
-1, // y coordinate (absolute) of left corner of this menu list, -1 if the coordinate is defined from parent y-coordinate
new Array (
'First', 'http://www.sun.com',
'Second', 'http://www.2.net',
'Third', 'http://www.3.net'
));


menuContent [2] = new Array (
1,
0,
150,
-1, // x coordinate (absolute) of left corner of this menu list, -1 if the coordinate is defined from parent x-coordinate
-1, // y coordinate (absolute) of left corner of this menu list, -1 if the coordinate is defined from parent y-coordinate
new Array (
'First', 'http://www.perl.com'
//IF I ADD 'second', 'www.site.com' HERE IT ADDS ON TO THE 'First' drop down
));



Here is how it is used in the function:

function createMenuTree ()
{
for (var i = 0; i < menuContent.length; i++)
{
menuElement [i] = new menuConstructor (i, menuContent [i]);
numOfMenus++;
}
}

createMenuTree ();

RadarBob
12-21-2002, 01:57 AM
Looks like you're missing a comma:

'First', 'http://www.perl.com', <-----