View Full Version : Help Please

Agent Moose
04-05-2007, 12:49 AM
This code is for beta.zetaboards.com. It creates a drop-down menu:

$(document).ready(function() {
//Created by Agent Moose and HolySavior
var mname = new Array()
mname[0] = "Pages"
mname[1] = "Other"

var dropdown = new Array()
dropdown[0] = ["Pages","Arcade","http://beta.zetaboards.com/MooseCreations/pages/arcade/"]
dropdown[1] = ["Other","Codes","http://beta.zetaboards.com/MooseCreations/pages/codes/"]

$("#top_menu").append("<li id='"+ mname[q] +"1'><a href='#'><img src='' /> "+ mname[q] +"</a><ul id='"+ dropdown[y][0] +"'></ul></li>");
$("#"+ dropdown[y][0] +"").append("<li><a href='"+ dropdown[y][2] +"'>"+ dropdown[y][1] +"</a></li>");

There are some problems with this code:
1. It creates 2 Page Dropdown menu and 2 Other. It should only create one of each. The mname is the name of the dropdown menu.
2. There is an ID for each of the options you want to put it in:

dropdown[0] = ["Pages","Arcade","http://beta.zetaboards.com/MooseCreations/pages/arcade/"]
The ID in it is Pages, which should match up to the name of the dropdown menu if you look farthur in the code.

I am trying to fix those problems but I had no luck so far, so I came here, anyone wanna help?