Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

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:06

Placing menu_data within the webpage


Poster: davidxyz
Dated: Tuesday April 27 2010 - 23:40:16 BST

Is it possible to place the "menu_data.js" data within the webpage HTML instead of having it referenced as a separate file. I will need this as I have an eCommerce site which will only parse the links within the page itself and not a separate file. Thanks.

Re: Placing menu_data within the webpage


Poster: Ruth
Dated: Wednesday April 28 2010 - 5:21:39 BST

Hi,

Are you saying you want to put the full 'text' that is in the data file into the html? Or do you want to call the data file in the html area someplace?

It's possible to just put the data file in script tags, a lot of people do that, but I'm not sure how that would read the links since the links are in the data file as url=whatever, so not sure how your program is going to know that is an a href= link. I know that many people who use eCommerce also use the Milonic menu. If you want to try it on the page, you can just copy and paste the data file between script tags.

You can also try contacting Milonic directly at this link http://www.milonic.com/support/

If I have misunderstood what you are asking, place let me know.

Ruth

Re: Placing menu_data within the webpage


Poster: davidxyz
Dated: Friday April 30 2010 - 14:20:33 BST

Yes, I want to put the full text from the "menu_data.js" file in the HTML. I need to put it in script tags? And how do I reference it from the "<script type="text/javascript" src="/scstore/script/menu_data.js"></script>" tag?

Thanks

Re: Placing menu_data within the webpage


Poster: Ruth
Dated: Friday April 30 2010 - 23:03:49 BST

Hi,

Yes, you'd put it in script tags. Since you are putting it on the html page you wouldn't call it, it's just on the page, like this as an example:

Code:
<html>
<head>
<title>Milonic DHTML/JavaScript Menu Sample Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
BODY{
   FONT-FAMILY:verdana;
   font-size:12px;
   background-color:#FFFFFF;
}

</style>   
</head>

<body>
      
<!--
    Milonic DHTML Website Navigation Menu Version 5.0+
    Copyright 2006 (c) Milonic Solutions Limited (UK). All Rights Reserved.
    Please visit http://www.milonic.com/ for more information.

    Although this software may have been freely downloaded, you must obtain a license before using it in any production environment.      
    The free use of this menu is only available for Non-Profit, Educational & Personal Web Sites who have obtained a license to use.
   
    Free, Commercial and Corporate Licenses are available from our website.
    You also need to include a link back to http://www.milonic.com/ if you use the free license.
   
    All Copyright notices MUST remain in place at ALL times.
    This includes the first three lines of this notice on every page that uses the menu.
    If you cannot comply with all of the above requirements, please contact us to arrange a license waiver.
-->   

<!-- ***** This is the section of code you need to paste into your web pages ***** -->
<script type="text/javascript" src="milonic_src.js"></script>   
<script type="text/javascript" src="mmenudom.js"></script>
<noscript><a href=http://www.milonic.com/>Milonic JavaScript Menu is only visible when JavaScript is enabled</a></noscript>
<!-- The next file contains your menu data, links and menu structure etc -->

<script type='text/javascript'>
fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;

with(menuStyle=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
fontfamily="Verdana, Tahoma, Arial";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#eeeeee";
offcolor="#000000";
onbgcolor="#ddffdd";
oncolor="#000099";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=3)";
padding=4;
pagebgcolor="#82B6D7";
pagecolor="black";
separatorcolor="#999999";
separatorsize=1;
subimage="arrow.gif";
subimagepadding=2;
}

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
orientation="horizontal";
style=menuStyle;
aI("text=Home;url=http://www.milonic.com/;title=milonic home page;");
aI("showmenu=Samples;text=Menu Samples;");
}

with(milonic=new menuname("Samples")){
overflow="scroll";
style=menuStyle;
aI("text=Plain Text Horizontal Style DHTML Menu Bar;url=http://www.milonic.com/menusample1.php;")
aI("text=Vertical Plain Text Menu;url=http://www.milonic.com/menusample2.php;")
}

drawMenus();

</script>

<!-- **** JavaScript Menu HTML Code -->

The content stuff on the page

</body>
</html>


I'm not sure if that is what you want or not. Most people don't put the full text on the page, but I have seen it there, usually in things like cfm, php, asp pages and such. You'll note that this has nothing to do with positioning it relatively, i.e. in a table or div, if that is what you are doing there is a different method. The top section and the submenus would go in script tags right after the call for the program files right after the body tag, and then the main menu with a drawMenus(); at the end [you would have two drawMenus(); one with the file with submenus and one in the main menu] Anyway, the main menu would then be put in the table or div in script tags set with position='relative' rather than having the top=; left=; set.

Hope this helps.

Ruth