Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:27
Showmenu call causes Javascript error
Poster: kitlamoureux
Dated: Wednesday October 26 2005 - 15:19:13 BST
This problem first manifested itself whereby rolling over the second item in my menu caused a listbox Jump menu i had on the same page to disappear. Now it is interferring with FLash playback. the following Javascript error is being generated when i rollover the "Core Competencies" item of my menu:
Line: 21
Char: 12254
Error. '_gt.2' is null or not an object
Code:0
URL <etc.>
THe menu code is as follows:
Code:
_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_subOffsetTop=0 // Sub menu top offset
_subOffsetLeft=0 // Sub menu left offset
with(menuStyle=new mm_style()){
offclass="opaque";
onbgcolor="#CCCCCC";
oncolor="#515151";
offbgcolor="#E4E5E9";
offcolor="#003366";
bordercolor="#979765";
borderstyle="none";
borderwidth=1;
separatorcolor="#ffffff";
separatorsize="1px";
padding="4px 5px 10px 5px";
fontsize="11px";
fontstyle="bold";
fontfamily="arial,_sans";
pagecolor="black";
pagebgcolor="#E4E5E9";
headercolor="#ffffff";
headerbgcolor="#E4E5E9";
subimage="/images/nav/spacer.gif";
subimagepadding="0";
width=117;
}
with(milonic=new menuname("Home")){
style=menuStyle;
top=105;
left=0;
alwaysvisible=1;
followscroll=0;
orientation="vertical";
aI("text=<label for=search><input type=text name=search id=search value=search size=7/></label><input type=submit value=go />;type=form;");
//aI("text=<form method=get action=search.asp><label for=search><input type=text name=search id=search value=search size=7/></label><input type=submit value=Go /></form>;type=form;");
aI("text=Contact Us;padding=0px 5px 30px 5px;showmenu=ContactUs;url=/contactus/index.asp");
aI("text=<strong>About Us</strong>;url=/aboutus/index.asp;showmenu=About Us;");
aI("text=<strong>Core<br />Compentencies</strong>;url=/core/index.asp;showmenu=CoreComps");
aI("text=<strong>Case Studies</strong>;url=/casestudies/index.asp;showmenu=Case Studies;");
aI("text=<strong>Industries</strong>;url=/industries/index.asp;showmenu=Industries;");
aI("text=<strong>Specialty Services</strong>;url=/specservices/index.asp;showmenu=Specialty Services;");
aI("text=<strong>Publications</strong>;url=/publications/index.asp;showmenu=Publications;");
aI("text=Sitemap;padding=16px 5px 42px 5px;");
aI("image=/images/nav/HodesGlobalNetwork.gif;url=/globalnetwork/index.asp;showmenu=GlobalNetwork");
}
with(milonic=new menuname("About Us")){
style=menuStyle;
overflow="scroll";
aI("text=Our Story;url=/aboutus/ourstory.asp;");
aI("text=Values;url=/aboutus/values.asp;");
aI("text=People;url=/aboutus/people/index.asp;");
aI("text=Press Room;url=/aboutus/pressroom/index.asp;");
}
with(milonic=new menuname("CoreComps")){
style=menuStyle;
overflow="scroll";
aI("text=Recruitment Marketing;url=/core/recruitment.asp;");
aI("text=Sourcing/Response Management;url=/core/sourcing.asp;");
aI("text=Hiring Process Reengineering;url=/core/reengineering.asp;");
aI("text=Staffing Technology;url=/core/staffingtech.asp;");
aI("text=Our Process;url=/core/process.asp;");
}
with(milonic=new menuname("Case Studies")){
style=menuStyle;
overflow="scroll";
aI("text=By Client;url=/casestudies/index.asp;");
aI("text=By Industry;url=/casestudies/index_industry.asp;");
aI("text=By Solution;url=/casestudies/index_solution.asp;");
}
with(milonic=new menuname("Industries")){
style=menuStyle;
overflow="scroll";
aI("text=Health Care;url=/industries/healthcare/index.asp;");
aI("text=Government;url=/industries/government.asp");
aI("text=Finance;url=/industries/finance.asp;");
aI("text=Transportation;url=/industries/transportation.asp;");
aI("text=Technology;url=/industries/technology.asp;");
aI("text=Aerospace;url=/industries/aerospace.asp;");
aI("text=Pharmaceutical;url=/industries/pharmaceutical.asp;");
aI("text=Retail;url=/industries/retail.asp;");
aI("text=Entertainment;url=/industries/entertainment.asp;");
aI("text=Utilities;url=/industries/utilities.asp;");
}
with(milonic=new menuname("Specialty Services")){
style=menuStyle;
overflow="scroll";
aI("text=Advertising;url=/specservices/advertising.asp;");
aI("text=Branding;url=/specservices/branding.asp;");
aI("text=Campus;url=/specservices/campus.asp;");
aI("text=Diversity;url=/specservices/diversity/index.asp;");
aI("text=Hodes iQ;url=/http://www.hodesiq.com;");
aI("text=Public Relations;url=/specservices/pr.asp;");
aI("text=Interactive;shopwmenu=Interactive;url=/specservices/interactive/index.asp;");
aI("text=Media PLanning;url=/specservices/mediaplanning.asp;");
aI("text=Outsourcing;url=/http://www.resjobs.com;");
aI("text=Research;url=/specservices/research.asp;");
}
with(milonic=new menuname("Publications")){
style=menuStyle;
overflow="scroll";
aI("text=White Papers;url=/publications/whitepapers.asp;");
aI("text=Newsletters;url=/publications/newsletters.asp;");
aI("text=Books;url=/publications/books.asp;");
aI("text=Recruitment Directory;url=http://www.hodesrecruitmentdirectory.com");
aI("text=Interviews;url=/publications/interviews/index.asp;");
}
with(milonic=new menuname("GlobalNetwork")){
style=menuStyle;
overflow="scroll";
aI("text=Our Network;url=/globalnetwork/ournetwork/");
aI("text=Our Work;url=/globalnetwork/ourwork/");
aI("text=Press;url=/globalnetwork/press/");
aI("text=Contact Network;url=/globalnetwork/contactnet.asp");
}
with(milonic=new menuname("Diversity")){
style=menuStyle;
overflow="scroll";
aI("text=Our Team;");
aI("text=Solutions;");
aI("text=Resources;");
aI("text=Portfolio;");
aI("text=Features;");
aI("text=Goodies;");
}
with(milonic=new menuname("Healthcare")){
style=menuStyle;
overflow="scroll";
aI("text=Our Team;");
aI("text=Solutions;");
aI("text=Resources;");
aI("text=Portfolio;");
aI("text=Features;");
aI("text=Goodies;");
aI("text=Forum;");
}
with(milonic=new menuname("Interactive")){
style=menuStyle;
overflow="scroll";
aI("text=Our Team;");
aI("text=Solutions;");
aI("text=Resources;");
aI("text=Portfolio;");
aI("text=Features;");
}
with(milonic=new menuname("ContactUs")){
style=menuStyle;
overflow="scroll";
aI("text=Locations - North America;url=/contactus/locations/index_na.asp");
aI("text=Locations - The World;url=/contactus/locations/index_world.asp");
}
drawMenus();
The menu is enclosed in a DIV tag as follows:
Code:
<!-- Menu Section -->
<div id="menu">
<img src="/images/nav/menutop_globalnetwork.gif" width="117" height="16" /><br />
</div>
<script type="text/javascript" src="/js/menu_data.js"></script>
<!--
Milonic DHTML Website Navigation Menu Version 5.0+
Copyright 2004 (c) Milonic Solutions Limited (UK). All Rights Reserved.
Please visit http://www.milonic.com/ for more information.
-->
<div id="menu">
<img src="/images/nav/menutop_globalnetwork.gif" width="117" height="16" /><br />
</div>
<script type="text/javascript" src="/js/menu_data.js"></script>
<!--
Milonic DHTML Website Navigation Menu Version 5.0+
Copyright 2004 (c) Milonic Solutions Limited (UK). All Rights Reserved.
Please visit http://www.milonic.com/ for more information.
-->
And positioned with the following CSS in an imported style sheet:
Code:
div#menu {
position: absolute;
left: 0px;
top: 89px;
width: 120px;
z-index:10;
}
position: absolute;
left: 0px;
top: 89px;
width: 120px;
z-index:10;
}
I have tried removing the Showmenu call on this menu element and that seems to prevent the error, so it must have soemthing to do with the Showmenu call. THe menu called is identicial to the submenus before and after and they dont cause a problem.
Any thoughts would be greatly appreciated.
Thanks,
Kit[/code]
Poster: Ruth
Dated: Wednesday November 2 2005 - 20:07:30 GMT
Hi Kit,
The only thing I see different is the break code. Have you tried removing that to see if it fixes the problem?
Ruth
Break code?
Poster: kitlamoureux
Dated: Thursday November 3 2005 - 2:03:54 GMT
Hi Ruth,
Thanks for getting back to me...what do you mean by "break code?" at this point, i will try anything.
Thanks,
Kit
Poster: Ruth
Dated: Thursday November 3 2005 - 5:08:25 GMT
In the one you say causes the problem you have
Code:
=<strong>Core<br />Compentencies</strong>;
I think maybe that br is causing the problem. It may only need to have the / taken out of it, but you'd have to test for that.Also, I wanted to ask why you're using the code in the aI strings instead of just using fontweight="bold"; in the style?
The codes for font are fontstyle="normal" or "italic" and for bold or non bold it would be fontweight="bold"; So, since that first menu has mostly bold, you could create a second style using the copyOf method which would only have the change in the fontweight, everything else would be the same, and then in the one aI that uses normal weight, you'd code in the aI string
Code:
aI("text=Sitemap;padding=16px 5px 42px 5px;fontweight=normal;");
And to create a different style for that menu you'd add this below the existing style Code:
homeStyle=new copyOf(menuStyle);
homeStyle.fontweight="bold";
homeStyle.fontweight="bold";
Then in that Home menu you'd call that style, style=homeStyle; Using that copyOf method means that it will take all that is in the menuStyle and only change whatever item you changed, in this instance the fontweight.
Below my name are links to the various style, menu and item properties, and there is also a beginners' guide forum section which is a quick read and very basic.
Ruth
<br /> still didnt fix...
Poster: kitlamoureux
Dated: Friday November 4 2005 - 17:52:16 GMT
Hey Ruth,
THanks for the tuneup on the font weight etc; that made a lot of sense and works well.
I am still having the issue with the submenu call on that item however. I tried removing the whole br tag, just removing the slash, and i still get the same error about _gt.2 is null or not an object.
Any idea what that statement is referring to?
Regards,
Kit
Poster: Ruth
Dated: Friday November 4 2005 - 19:31:38 GMT
We are going to have to see the page. I just used your code to make a page and I am not having any problems in IE5.5, Netscape7.1, FireFox1.0.2 using Version 5.734 which is the version you should have, the most recent one.
Ruth
Sure..and while you are there...
Poster: kitlamoureux
Dated: Tuesday November 8 2005 - 22:24:02 GMT
OK...The site is http://www2.beta.hodes.com
go to the Global Network element on the bottom of the menu.
Rollover Core Competencies ont eh side nav and the Pick a country element will disappear. and the error will appear.
And while you are it....
Any idea on why the submenu items are offset to the right handsidein Firefox? I had to center the layout for my boss and it isnt quite working...
Thanks,
Kit
Poster: Ruth
Dated: Tuesday November 8 2005 - 23:30:09 GMT
Hi,
It has something to do with putting that menu_data.js file in the div. When I removed it from the div the drop down no longer disappeared when I moused over the Core Competencies. As for the offset in Firefox, I have to think it's the div and/or something in the css. I'm sorry I'm unable to find it.
Since you have a professional license, you might contact Milonic from the main site with teh problem.
Ruth