Javascript menu bug?

Status
Not open for further replies.

ButtermilkJack

New Member
Just wondering if anyone can help me fix a slight bug on a site I completed a while back?

I've noticed that the main menu 'auto-expands' the "Company" sub-menu when you land on the homepage and I can't figure out why. It doesn't do this if you type index.htm after the domain though :confused: (or click on the "Home" button), and it doesn't show the "company.htm" page either, just expands the sub-menu.

Bear in mind I'm a JS novice and just cut'n'pasted the javascript from a free tutorial so don't know where to start?

Thanks!

EDIT: Javascript is here
 

ph3n0m

New Member
comment out or remove the following lines in your javascript

this will prevent the auto expansion from happening - if you want to go the other route, and have the expansion happen either way, let me know

Code:
            if(aTags[no].href.indexOf(fileNameThis)>=0 && aTags[no].href.charAt(aTags[no].href.length-1)!='#'){                
                if(aTags[no].parentNode.parentNode){                                
                    var parentObj = aTags[no].parentNode.parentNode.parentNode;
                    var a = parentObj.getElementsByTagName('A')[0];
                    if(a.id && !activeMenuLink){
                        
                        activeMenuLink = aTags[no];
                        activeMenuItem = a.id;
                    }
                }
            }
 
Status
Not open for further replies.
Top