Irish SEO,  Marketing & Webmaster Discussion

 

Javascript menu bug?

This is a discussion on Javascript menu bug? within the Coding Help forums, part of the Webmaster Help category; Just wondering if anyone can help me fix a slight bug on a site I completed a while back? I've ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-01-2007, 04:29 PM
ButtermilkJack's Avatar
Wannabe Geek
 
Join Date: Feb 2006
Location: Dublin, Ireland
Posts: 260
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ButtermilkJack will become famous soon enough
Default Javascript menu bug?

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 (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
__________________
Print & Web Design
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 15-01-2007, 02:21 PM
ph3n0m's Avatar
Webmonkey
 
Join Date: Jan 2006
Location: Ireland
Posts: 297
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ph3n0m will become famous soon enough
Send a message via AIM to ph3n0m Send a message via MSN to ph3n0m Send a message via Yahoo to ph3n0m Send a message via Skype™ to ph3n0m
Default

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;
                    }
                }
            }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
bug, javascript, menu

« iframe | Photo Site »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
CSS Issue for Wordpress Menu.. Cormac Coding Help 4 03-12-2006 02:12 PM
Javascript Captcha for use on forms louie Coding Help 8 23-10-2006 09:22 AM
Javascript Menu Help (again...)? ButtermilkJack Coding Help 18 25-04-2006 12:32 PM
Javascript/CSS menu help? ButtermilkJack Coding Help 4 16-04-2006 05:59 PM


All times are GMT +1. The time now is 05:06 AM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0