Launch menu via onlclick
Launch menu via onlclick
Hi to all of you,
I've downloaded a free version of the Classic XP Style Menu in order to test it before purchaising it!
However i've got this problem!
I'm gonna use two menus on my webpage
and one should be opened via a button
i mean that the customer should click on a button then the menu appears!
as soon as the customer leave the menu via onmouseout, the menu should disappear!
How can i do that please??
thanks in advance
I've downloaded a free version of the Classic XP Style Menu in order to test it before purchaising it!
However i've got this problem!
I'm gonna use two menus on my webpage
and one should be opened via a button
i mean that the customer should click on a button then the menu appears!
as soon as the customer leave the menu via onmouseout, the menu should disappear!
How can i do that please??
thanks in advance
Code: Select all
openonclick Allows the menu to be opened by a click of the mouse on the main menu
rather than it automatically opening as the mouse rolls over it. Values: 'true', 'false',
'0' or '1' Example: openonclick=true;
Example: openonclick=0;
There are some reference guides for different menu properties, style properties and item properties that can be applied. The links are below my name.
Ruth
Last edited by Ruth on Mon Mar 07, 2005 10:51 am, edited 2 times in total.
Hi,
You would just create a menu that you want to be the 'button' it can be text or an image. You create it just like any menu. Then you code it like it's the main menu, which in effect it will be, setting it to always visible, setting the top, left etc. In it you would code the item that you want to open the main menu openonclick=true; The normal action of the menu when using openonclick is to have the click open the called menu and from that point on all menus will open and close when you move the mouse over and off. You then get rid of the main menu positioning and always visible so it acts like a submenu. i.e. That would open the menu named main menu
In effect what you are doing is just making the main menu act as a submenu, and creating a 'button' to open it with a click. You could use an image for that button menu, and you could set the menu to followscroll=1; if you want the menu to follow the scroll down the page. It finishes it's scroll always at the top of the browser window.
Milonic Menus are very versatile. You could even use this to have a number of buttons that are always visible and will open the main menu. You would just have to make a different menu, say button, button1, button2 have each one showmenu=main menu, and set each one to the position you want it to have on the page.
Ruth
You would just create a menu that you want to be the 'button' it can be text or an image. You create it just like any menu. Then you code it like it's the main menu, which in effect it will be, setting it to always visible, setting the top, left etc. In it you would code the item that you want to open the main menu openonclick=true; The normal action of the menu when using openonclick is to have the click open the called menu and from that point on all menus will open and close when you move the mouse over and off. You then get rid of the main menu positioning and always visible so it acts like a submenu. i.e.
Code: Select all
with(milonic=new menuname("Button")){
style=menuStyle;
top=10;
left=20;
alwaysvisible=1;aI("text=Click for Menu;openonclick=true;showmenu=main menu;"); }
Code: Select all
with(milonic=new menuname("Main Menu")){
style=menuStyle;
orientation="horizontal";
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Menu Samples;align=center;showmenu=Samples;title=All Samples");
aI("text=Milonic;showmenu=Milonic;"); aI("text=Back;url=javascript:history.go(-1);");
aI("text=Next;url=javascript:history.go(+1); ");
}
Milonic Menus are very versatile. You could even use this to have a number of buttons that are always visible and will open the main menu. You would just have to make a different menu, say button, button1, button2 have each one showmenu=main menu, and set each one to the position you want it to have on the page.
Ruth
Thanks Ruth, it perfectly answer to my problem!
Nevertheless, I still have another question which relates to something else!
In my website i've got a multilanguage script made in php which workds perfeclty!
Consequenlty i want your menu to also appear in all languages and my question is the following:
i need to replace Home by an <?php echo "txt-men1" ;?> in the line below
aI("status=Back To Home Page;text=Home;url=http://www.milonic.dev/;");
How can i add php script in a js file?
If not possible as i think, am i supposed to create different version of the file menu_data.js??
Thanks in advance
Nevertheless, I still have another question which relates to something else!
In my website i've got a multilanguage script made in php which workds perfeclty!
Consequenlty i want your menu to also appear in all languages and my question is the following:
i need to replace Home by an <?php echo "txt-men1" ;?> in the line below
aI("status=Back To Home Page;text=Home;url=http://www.milonic.dev/;");
How can i add php script in a js file?
If not possible as i think, am i supposed to create different version of the file menu_data.js??
Thanks in advance
I have not a clue, that is way over this volunteer's head. A few thoughts come to mind
1. as you mentioned, making a different data file for each language. I've seen that on a number of sites, when the person clicks Spanish, the corresponding pages load with their spanish_data.js file
2. Someone in a post suggested writing text for the menus and using an if/else statement. Again, this is outside my field of knowledge
3. There is a php/mysql Milonic Menu. You can see that here There is a download zip file for that. It also has an asp/mysql. I have no idea what any of that is, so I don't know if any of it would be useful.
I know that this site's menu data file is a php menu_data.php and there are some posts on using php/mysql
viewtopic.php?p=13223
viewtopic.php?p=23523
viewtopic.php?p=21693
viewtopic.php?p=19081
viewtopic.php?p=18361
And, I remember in one post something about making different files and then using an if/else to call them.
I don't know if any of that will help you.
Ruth
1. as you mentioned, making a different data file for each language. I've seen that on a number of sites, when the person clicks Spanish, the corresponding pages load with their spanish_data.js file
2. Someone in a post suggested writing text for the menus and using an if/else statement. Again, this is outside my field of knowledge
3. There is a php/mysql Milonic Menu. You can see that here There is a download zip file for that. It also has an asp/mysql. I have no idea what any of that is, so I don't know if any of it would be useful.
I know that this site's menu data file is a php menu_data.php and there are some posts on using php/mysql
viewtopic.php?p=13223
viewtopic.php?p=23523
viewtopic.php?p=21693
viewtopic.php?p=19081
viewtopic.php?p=18361
And, I remember in one post something about making different files and then using an if/else to call them.
I don't know if any of that will help you.
Ruth
Thanks for all your help, scrit now works perfectly!
Nevertheless, i still have one last interrogation!
i need to change the height of the image: test.gif
aI("image=img menu/test.gif;openonclick=true;showmenu=main menu;"); }
Indeed, i need to fix it to 33..
how can i do that within your script!
thanks in advance
Nevertheless, i still have one last interrogation!
i need to change the height of the image: test.gif
aI("image=img menu/test.gif;openonclick=true;showmenu=main menu;"); }
Indeed, i need to fix it to 33..
how can i do that within your script!
thanks in advance
I'm not sure what you mean. Since that menu is a one item menu and you are using image= then the menu will be whatever size the image is. If you are thinking about an html page and how you can put in a different size for the image than it is and that's the size the browser makes it, no that doesn't happen in the menu.
You can do a number of things:
1. make the image the size you want the menu item to be.
2. use a blank image [an image without text] as a background and put text in the item, aI("text=Click here;bgimage=myimage.gif;itemheight=33px;
Below my name are some links to style, menu, item property references which describe the various properties. There is also a beginner's guide in the forum section, very basic as to using colors and such, and a Beginner's User Manual online which has much more information.
Ruth
You can do a number of things:
1. make the image the size you want the menu item to be.
2. use a blank image [an image without text] as a background and put text in the item, aI("text=Click here;bgimage=myimage.gif;itemheight=33px;
Below my name are some links to style, menu, item property references which describe the various properties. There is also a beginner's guide in the forum section, very basic as to using colors and such, and a Beginner's User Manual online which has much more information.
Ruth
If you have purchased the menu, then you need to be logged in when you download it, and it will put in the correct url for the menu and that link will not appear. If you are qualified for a free license, then you need to have the required link back to Milonic on every page on which the menu appears. Read this post by Milonic Menus And, here's information on the Free License.
Ruth
Ruth
O thanks, i'll leave the div line until i've finished the construction of my entire website and then come back to pruchase what is needed...
Last question however:
in a line like that:
aI("text=menu .....
how can i center the word menu, i mean how to put it in the middle of the background image??
thanks in advance
Last question however:
in a line like that:
aI("text=menu .....
how can i center the word menu, i mean how to put it in the middle of the background image??
thanks in advance
align is a property that can be used in either the style section, which means that all text will align at whatever you set, or it can be put into the menu itself, which means all text in that menu will align where you set it, or it can be put into the item and only that item will take on the align property.
Ruth
Ruth
Code: Select all
with(menuStyle=new mm_style()){
onbgcolor="#4F8EB6";
oncolor="#ffffff";
offbgcolor="#DCE9F0";align="center";
Code: Select all
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=10;
left=10;
alwaysvisible=1;
orientation="horizontal";
align="center";
Code: Select all
aI("text=Home;align="center";url=http://milonic.com/;status=Back To Home Page;");
Ruth
Code: Select all
aI("text=Lancer;align=center;bgimage=img.gif;itemheight=33px;itemwidth=101px;openonclick=true;showmenu=Main Menu;");
Ruth[/code]
I've corrected the problem, thanks for your help!
nevertheless, i'm confronted to another problem in relation to the position of the menu now
on my computer the fullcreen is working perfectly so the menu appears exactly where i want it, however as you might now due to sp2 other computer might not see the page in fullscreen consequently the menu is not placed where it should!!
let me explain the problem in much more details:
For instance for the button i've got that:
with(milonic=new menuname("Start")){
style=menuStyle;
LEcran = screen.height
top= LEcran- (32);
left=0;
alwaysvisible=1;
aI("text=Lancer;align=center;bgimage=imgmenu/baseline_begin.gif;itemheight=33px;itemwidth=101px;openonclick=true;showmenu=Main Menu;");
}
Nevertheless, as ohter comptuer might not use the total fullscreen mode the screen.height is not valid anymore!
so that i have to use the window.height i think!!
But my question is the following, in order to know if the customer is using fullcreen mode (the total mode) i need to compare the screen.height and window.height? Is that right? but how to do that?
and follqing the answer give the right coordination to the button?
i'll do the same for the menu in itself ,after...
Thanks in advance
nevertheless, i'm confronted to another problem in relation to the position of the menu now
on my computer the fullcreen is working perfectly so the menu appears exactly where i want it, however as you might now due to sp2 other computer might not see the page in fullscreen consequently the menu is not placed where it should!!
let me explain the problem in much more details:
For instance for the button i've got that:
with(milonic=new menuname("Start")){
style=menuStyle;
LEcran = screen.height
top= LEcran- (32);
left=0;
alwaysvisible=1;
aI("text=Lancer;align=center;bgimage=imgmenu/baseline_begin.gif;itemheight=33px;itemwidth=101px;openonclick=true;showmenu=Main Menu;");
}
Nevertheless, as ohter comptuer might not use the total fullscreen mode the screen.height is not valid anymore!
so that i have to use the window.height i think!!
But my question is the following, in order to know if the customer is using fullcreen mode (the total mode) i need to compare the screen.height and window.height? Is that right? but how to do that?
and follqing the answer give the right coordination to the button?
i'll do the same for the menu in itself ,after...
Thanks in advance
I have no idea. I don't even know is doing. You need to put this as a new topic, with a new title that refers to the issue, where someone else will see it based on the topic title.
As requested, we need to see a url and the page. There's no way we can 'visualize' without know what you want. For example, if you want the menu in the same place, no matter the window size, perhaps placing that menu button in a table would be the solution, if you are using tables. It would always be in the same cell no matter the resolution the person is using and how the table shifts as the resolution changes.
Ruth
Code: Select all
what LEcran = screen.height
top= LEcran- (32);
As requested, we need to see a url and the page. There's no way we can 'visualize' without know what you want. For example, if you want the menu in the same place, no matter the window size, perhaps placing that menu button in a table would be the solution, if you are using tables. It would always be in the same cell no matter the resolution the person is using and how the table shifts as the resolution changes.
Ruth