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

Classic Xp dhtml menu onlick launch


Poster: Darkangel
Dated: Wednesday November 23 2005 - 16:52:55 GMT

HI everybody,

I've tried to launch the main menu with this code!

with(milonic=new menuname("Start")){
style=menuStyle;
alwaysvisible=1;
aI("text=Menu;align=center;bgimage=start.gif;itemheight=33px;itemwidth=101px;openonclick=true;showmenu=Main Menu;");}

but it doesn't work it tells me the following error:
it tells me menuStyle is undefined!!

Could you please tell me what is wrong!

Thanks in advance


Poster: Darkangel
Dated: Wednesday November 23 2005 - 19:00:35 GMT

Could someone help me please!
It might be a basic problem but i don't know how to solve it!

Thanks in advance


Poster: Ruth
Dated: Wednesday November 23 2005 - 19:42:50 GMT

Could you post a link please so we can see the page. I need to find out about the menuStyle problem.

Ruth


Poster: Darkangel
Dated: Wednesday November 23 2005 - 19:49:20 GMT

I'm currently bulding this websit but under a local server!
so i cannot!
the thing is that i just add the above code in the menu data file!!
that's all i've done!
normally it should have work because i read different post about this subject!

hope you could help me!!
i just want the main menu to appear when the user click on the button start!!


Poster: Ruth
Dated: Wednesday November 23 2005 - 19:52:25 GMT

Hi,

You'll need to post the html page code, any css and the menu_data.js file code here so I can make the page. There's no way for me to figure out what's up without seeing the page.

Use the code button above. Thanks

Ruth


Poster: Darkangel
Dated: Wednesday November 23 2005 - 21:52:47 GMT

Ok so let me be as precise as possible:

The thing is that it's a total new html page in which i would like to have your dhtml menu.

i'v just download the sample of your classic xp dhtml menu and install it. http://www.milonic.com/menusample82.php

Besides, i just modify the menu_data.js file in order to add certain modifications.

Indeed, i want the main menu to be launched not automatically but when the user will click the button start!

Here are the lines i've modified!

Code:
------------------------------------
with(milonic=new menuname("Start")){
style=menuStyle;
screenposition:"bottom,left";
alwaysvisible=1;
aI("text=Menu;align=center;bgimage=start.gif;itemheight=33px;itemwidth=101px;openonclick=true;showmenu=Main Menu;");}

------------------------------------
THIS WHOLE PART FOR START HAD BEEN ADDED!


Code:
with(milonic=new menuname("Main Menu")){
alwaysvisible=0; [b]// MODIFICATION[/b]
screenposition="bottom,left"; top="offset=-25";  [b]// MODIFICATION[/b]
orientation="vertical";
style=submenuStyle;
aI("status=Back To Home Page;subimageposition=0                             ;text=Home;url=http://www.milonic.com/;");
aI("showmenu=Milonic;subimageposition=0                             ;text=Milonic;");
aI("image=clxp_hand.gif;showmenu=Partners;subimageposition=0                             ;text=Partners;");
aI("showmenu=Links;subimageposition=0                             ;text=Links;");
aI("showmenu=My Milonic;subimageposition=0                             ;text=My Milonic;");

}


my problem is that no button appear at all, the image is not loaded! the only thing which appear is an error!

" menuStyle is undefined"!

Could you please tell me what happen??
ps: there is no need to have any page as the only thing i'm trying is in a new html page!


Thanks in advance
best regards
Code:
[b][/b]


Poster: Ruth
Dated: Wednesday November 23 2005 - 22:21:10 GMT

The menu_data.js file contains no style called menuStyle, so the program cannot find that style to apply to your Start menu. If you are taking this from a different existing menu, then either copy and paste the menuStyle to the xp menu_data.js file or rename the style for that start menu.

Ruth


Poster: Darkangel
Dated: Wednesday November 23 2005 - 23:51:41 GMT

humh ok!

so let's see the problem in an other way!

i just want to launch the main menu through a simple link on my html page!

isn't there a way to do it in a simple way such a <a onclik="showmenu...
i don't know

hope you could tell me the answer!


Poster: Ruth
Dated: Wednesday November 23 2005 - 23:57:55 GMT

It's fine the way it is, just change

Code:
with(milonic=new menuname("Start")){
style=menuStyle;


to

Code:
with(milonic=new menuname("Start")){
style=submenuStyle;


Since you have coded the aI string with the bgimage= it will take that as the bgimage.

I don't know how to make an html link to show a Milonic menu.

When you use a sample, any sample, you can change the names of styles, add styles, delete styles if it has more than one but you are going to have all the menus use the same style. So, you could even rename the subMenuStyle to menuStyle and just make sure you rename all the style= in all the menus.

Ruth


Poster: Darkangel
Dated: Thursday November 24 2005 - 1:34:43 GMT

it's fine ! it works now!

however just another simple question!

on this line: aI("text=menu;bgimage=start.gif

how could we change the color or the word menu in white for example??


Poster: Darkangel
Dated: Thursday November 24 2005 - 1:41:29 GMT

Besides,

i still need to solve the color problem but another also!!

Code:
alwaysvisible=1;
screenposition="bottom,left"; top="offset=-1";
aI("text=Démarrer;bgimage=start.gif;itemheight=25px;itemwidth=100px;openonclick=true;showmenu=Main Menu;");}


indeed there is a problem with the itemheight!
following the size of the window, the size of the image had to follow!
meaning that i should use % instead of px!
but it doesn't work!!


Poster: Ruth
Dated: Thursday November 24 2005 - 2:54:12 GMT

I'm very sorry but I am not a code person nor a programmer. I can't just read words and say, oh this is what the person means. I need to have a page or a more indepth explanation. Do you mean if the browser resolution changes you want the item height to get bigger than the rest of the page now? You have it set so the item is always 33px, it will be 33px no matter what the resolution of the browser, of course it will look smaller at higher resolutions, but then the whole page looks smaller at higher resolutions. If you mean you don't want the text size to change the only way you can do that is to use an image, though just like everything else on the page an image will 'look' smaller at higher resolutions. If you could post some screenshots or something showing the differences and explain what you want to happen I might be able to figure it out.


As to changing the color of the word text, you can also use many of the various properties in the aI to change one item and make it different from the style that is applied, like the offcolor and oncolor which refers to the color of the text when the mouse is not on it or when it is on it. So, you want the text to be white for that item you would put the item like this

Code:
aI("text=Menu;align=center;offcolor=#ffffff;oncolor=#ffffff;bgimage=start.gif;itemheight=33px;itemwidth=101px;openonclick=true;showmenu=Main Menu;");}


You would make the offcolor and oncolor whatever you want them to be they do NOT have to be the same.


In order to better understand about the menu I suggest you take a look at this forum

There are three sections which talk about styling the menu and some other posts with basic information.

Below my name are also links to properties, style properties which go in the
Code:
with(menuStyle=new mm_style()){ 
or whatever the style name is, menu properties which go in the section
Code:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;style=menuStyle;
and item properties which go into any of the aI strings.

Ruth


Poster: Darkangel
Dated: Thursday November 24 2005 - 10:02:40 GMT

Thnaks for this long explanation!
I understand what you mean and of course my image will look smaller if the resolution is higher!

what i just want to say is that if a person with a normal resolution do not maxmize the active ie window for isntance and reduce it slightly the image is still at 33px and is not reduced!


Concretely the only thing i have in my page is an image on the backside:
<div id="fond" style="position:absolute; width:100%; height:4%; z-index:1; bottom: 0px; left: 0; background-image : url(Images/Bureau/fond.gif); background-repeat : repeat-x;">

you can here see that the height is fixed at 4% of the screen height:
what i need is that the start button of my menu_data.js file should be the same
meaning that i need to modify this part!

Code:
with(milonic=new menuname("Start")){
style=menuStyle;
alwaysvisible=1;
screenposition="bottom,left"; top="offset=-1";
aI("text=Démarrer;bgimage=start.gif;itemheight=25px;itemwidth=100px;openonclick=true;showmenu=Main Menu;");}


and more precisely the itemheight. Here the itemheights is fixed at 25px but i want ti to be fiexed at 4%... i've tried to just put itemheight=4% but it doesn"t work!


Poster: Darkangel
Dated: Thursday November 24 2005 - 10:08:24 GMT

forget what i've said it seems to work now..
thanks for all