OK, this may sound a little convoluted; so I hope you all can stil understand my question.
I’m trying to construct a customizable drop-down menu. I have several global variables defined at the top of the script:
var strMenus = “Menu One=#,Menu Two=#,Menu Three=#,Menu Four=#,Menu Five=#,Menu Six=#”
var menu1= “Menu Item One=#,Menu Item Two=#,Menu Item Three=#,Menu Item Four=#,Menu Item Five=#,Menu Item Six=#”
var menu2= “Menu Item One=#,Menu Item Two=#,Menu Item Three=#,Menu Item Four=#,Menu Item Five=#,Menu Item Six=#”
etc …
I can split the first line into an array.(As there is only 1 menu header ever and the variable name is known – ‘strMenus’) Then I’m using the array data to contstruct the menu header. No problem.
But when I get down into the for loop that is constructing the menu and subsequent drop-down DIVs, I am dealing with an unknown number of potential drop-downs. I can get it — as the length of the strMenus array, but how can I ‘dynamically’ refer to a global variable? (or local)
I can pass the number of the menu, and of course they’re all prefixed with ‘menu’ — but I do not understand how I can refer to the variable ‘menu1’ and then ‘menu2’ then ‘menu3’ – etc.
Does this question make sense? Any help would be greatly appreciated.
Ben Franklin