few errors installing/upg menu (mm_style & $ not defined

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
tooldonkey
Advanced
Advanced
Posts: 10
Joined: Fri Nov 08, 2002 5:09 pm
Location: VA

few errors installing/upg menu (mm_style & $ not defined

Post by tooldonkey »

mm_style is not defined (menu_data.js)
$ is not defined (mmenudom.js)

Thanks for any help!
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Sounds like a pathing problem. Got a URL (as requested)?
John
User avatar
tooldonkey
Advanced
Advanced
Posts: 10
Joined: Fri Nov 08, 2002 5:09 pm
Location: VA

Post by tooldonkey »

John wrote:Sounds like a pathing problem. Got a URL (as requested)?
No external url, sorry, but here's how I've got it set up:

Code: Select all

<head>
<!-- Menu Scripts -->
<script src="js/menu_data.js" type=text/javascript></script>
<script src="js/mmenudom.js" type=text/javascript></script>
<script src="js/milonic_src.js" type=text/javascript></script>
</head>

<body>
<a href="#" onClick="popup('production')" onMouseOut="popdn();"><img src="../images/gif/mnubr_pdtn-off.gif" alt="Production" width="87" height="18" border="0" id="img_rtn"></a>
</body>

User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Those JS calls are all wrong for the v5 menu system (see install.txt that came in the download).

Exactly what version are you running?
John
User avatar
tooldonkey
Advanced
Advanced
Posts: 10
Joined: Fri Nov 08, 2002 5:09 pm
Location: VA

Post by tooldonkey »

I've downloaded the latest one just a few mins ago. I dont see anything about the proper syntax to make a call in install.txt only where to put the script tags in the head. Am I missing something?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

tooldonkey wrote:I've downloaded the latest one just a few mins ago. I dont see anything about the proper syntax to make a call in install.txt only where to put the script tags in the head. Am I missing something?
Yep! :) Item #3...
3. Inform your web pages that you want the menu to appear when they are loaded.
To do this, you need to add the following JavaScript tags to your HTML page:

<script type="text/javascript" src="milonic_src.js"></script>
<div class=milonic><a href="http://milonic.com/">JavaScript Menu, DHTML Menu Powered By Milonic</a></div>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script type="text/javascript" src="menu_data.js"></script>

The position of the above is not particularly important, but it's advisable to
place these tags just after the <BODY> tag or in the <HEAD> of your document.
This help minimize the risk of a conflict with other objects. The order in which
the tags appear IS important, and must be as shown above.
John
User avatar
tooldonkey
Advanced
Advanced
Posts: 10
Joined: Fri Nov 08, 2002 5:09 pm
Location: VA

Post by tooldonkey »

I didnt want to use the milonic menu for the top level of my navigation bar, therefore i need to integrate it into my HTML. What is the syntax to make an onlick call?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

If you're using anything that comes from the menu you have to make those calls. Just don't define a main menu.

See openonclick= here (along with other 'click' items).

Mind if I ask what you're doing that you don't want/can't use Milonic for the Main?
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi tooldonkey,
tooldonkey wrote:...No external url, sorry, but here's how I've got it set up:

Code: Select all

<head>
<!-- Menu Scripts -->
<script src="js/menu_data.js" type=text/javascript></script>
<script src="js/mmenudom.js" type=text/javascript></script>
<script src="js/milonic_src.js" type=text/javascript></script>
</head>

<body>
<a href="#" onClick="popup('production')" onMouseOut="popdn();"><img src="../images/gif/mnubr_pdtn-off.gif" alt="Production" width="87" height="18" border="0" id="img_rtn"></a>
</body>

I'll throw in my two points' worth ;)

(1) Just to emphasize the most important point of John's comments about the <script> tags, here's the critical bit:
The order in which the tags appear IS important, and must be as shown above.
When you load the .js files for the menu, It's OK to remove the conditional test for ns4, assuming you don't care to support ns4 (in which case, bravo for you!). But the code you posted shows the .js files being loaded in exactly the opposite order of what they should be. This would account for the error messages. The order in which you load the .js files should be: milonic_src.js, mmenudom.js, then menu_data.js.

(2) Using popup(). If you're interested in building your top-level nav bar with separate images, then you'll be using the popup() function, as you apparently already knew. Your use of popup() that you showed in the sample code you posted looks like it's almost there. However, the way you've called popup(), with only one parameter, would open the submenu in the position that's defined within the menu (i.e., top=xxx; left=xxx; assuming they are defined), rather than at a position relative to the image. If there is no position defined within the submenu, then it'll either open at the page origin, or maybe not at all. Instead, you could open the submenu relative to the image's position or at the pointer's position (including optional offsets). Here's a sample of using popup(). You also might want to check out this page for documentaiton of the popup() function. Note that to open the submenu relative to the image's position will require that you set the name= attribute in the <img> tag as well as the id= attribute; both set to the same thing (it's an IE vs. Gecko thing).

(3) OK... I lied, I have three points. You call popdn() for the image's onMouseOut event. There is no popdn() function in the Milonic v5 system (I think that was the v3 name). Unless you have a popdn() function that you've defined yourself, you'll get an undefined object error (or some such) when you mouse off of the image. Instead, you might be looking for the built-in Milonic function called popdown(); aslo documented here.

Hope that helps,

Kevin
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

kevin3442 wrote:OK... I lied, I have three points.
Hmm - fer a $.03 plain. Inflation, I guess... :roll:
John
Post Reply