I have the following code for a dropdown menu that I am creating and the problem is that whilst the variables are being set correctly the for and if statement aren't functioning correctly.
Instead of allowing the dropdown menu to be activated onmouseover it flashes on/off briefly when the page is loaded and that's it.
Here is the code that I am working with:
Expand|Select|Wrap|Line Numbers
- function gatherItems(c){
- //alert("Function has been called and the id is: "+c);
- container = document.getElementById(c);
- items = container.getElementsByTagName('a');
- subs = container.getElementsByTagName('div');
- alert(items.length+" "+subs.length);
- //alert(items.id);
- for(var i=0;i<items.length;i++){
- if(items[i].id){
- items[i].onmouseover = show(items[i].id);
- items[i].onmouseout = delay();
- }
- }
- /*for(var s=0;s<subs.length;s++){
- if(subs[s].id){
- subs[s].onmouseover = canceldelay();
- subs[s].onmouseout = delay();
- }
- }*/
- }