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:49
few errors installing/upg menu (mm_style & $ not defined
Poster: tooldonkey
Dated: Monday March 28 2005 - 20:29:25 BST
mm_style is not defined (menu_data.js)
$ is not defined (mmenudom.js)
Thanks for any help!
Poster: John
Dated: Monday March 28 2005 - 20:31:23 BST
Sounds like a pathing problem. Got a URL (as requested)?
Poster: tooldonkey
Dated: Monday March 28 2005 - 20:37:54 BST
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:
<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>
<!-- 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>
Poster: John
Dated: Monday March 28 2005 - 20:44:51 BST
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?
Poster: tooldonkey
Dated: Monday March 28 2005 - 21:20:43 BST
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?
Poster: John
Dated: Monday March 28 2005 - 21:29:59 BST
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...
Quote:
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://www.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.
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://www.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.
Poster: tooldonkey
Dated: Monday March 28 2005 - 21:34:10 BST
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?
Poster: John
Dated: Monday March 28 2005 - 21:44:08 BST
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?
Poster: kevin3442
Dated: Tuesday March 29 2005 - 1:48:50 BST
Hi tooldonkey,
tooldonkey wrote:
...No external url, sorry, but here's how I've got it set up:
Code:
<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>
<!-- 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:
Quote:
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