I am trying to add a new link and create a new dropdown menu. Such that instead of 5 items in the menu, it'll now be six. The problem is any time i try to make changes , the changes don't reflect. Can you suggest what I have to to do as to make the menu reflect the new addition? Here is the code below for the previous 5.
- Code: Select all
var numofitems = 5;
//menu constructor
function menu(allitems,thisitem,startstate){
callname= "gl"+thisitem;
divname="bottom"+thisitem;
this.numberofmenuitems = allitems;
this.caller = document.getElementById(callname);
this.thediv = document.getElementById(divname);
this.thediv.style.visibility = startstate;
}
//menu methods
function ehandler(event,theobj){
for (var i=1; i<= theobj.numberofmenuitems; i++){
var shutdiv =eval( "menuitem"+5+".thediv");
shutdiv.style.visibility="hidden";
}
theobj.thediv.style.visibility="visible";
}
function closesubnav(event){
if ((event.clientX >800)||(event.clientY > 180)){
for (var i=1; i<= numofitems; i++){
var shutdiv =eval('menuitem'+5+'.thediv');
shutdiv.style.visibility='hidden';
}
}
}
// -->
</script>