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

Menus like Windows' one


Poster: tamagotchi
Dated: Monday September 13 2004 - 8:57:28 BST

Hi there...

Is it possible to simulate windows' menus ?

When I click, it opens, and then I can open the other menus just with my mouse over them, and when I click a menuitem, the menu or elsewhere, it closes.

Is it possible ?

Thanks a lot, my boss is shouting on me because I made him buy this menu and it is very important !


Poster: Andy
Dated: Monday September 13 2004 - 10:59:07 BST

This one should be easy.

All you need to do is add openonclick=1; to the aI() string that opens a submenu, like this:

Code:
aI("text=menuitem,showmenu=submenu;openonclick=1;");


Hope this helps
Andy


Poster: tamagotchi
Dated: Monday September 13 2004 - 12:37:39 BST

Thanks, but that's not the behavior I was expecting...

I have 5 menus (with submenus in each) like this

[MENU1] [MENU2] [MENU3] [MENU4] [MENU5]
| submenu 1 |
| submenu 2 |
| submenu 3 |

with your hint, I have to click on each menu to make him expand.

What i want to do is, once I click one of the 5 menus, the 4 others expand only on mouseover, not with click. In Internet Explorer for example, if i click on "File", the file menu expands. But at this moment I don't have to click on Edit, View, or Tools to expand it, unless I didn't click anywhere else to close it.

The schema would be like that :

1) I click on one of the 5 menus, the menu on which i clicked expands.
2) From now, I can over the 4 others to expand them (of course the old one will close himself)
3) to close my menus I have to :
a> click on one of the 5 menus
b> click on a subitem
c> click anywhere else in the page.

You can try this with your Internet Explorer menu bar...

Is there any way of combination with openonclick and keepalive, or should I change the code in source to reproduce the windows' menus behavior ? for example, I declare openonclick=1 for each menu, and when any menu open, I put openonclick=0 for all, and when any menu closes, I put openclick=1 for all back. In this way the openonclick would be 1 if all menus are closed, and 0 if any of the menus is open... Is it possible ?

Thank you, help would be very appreciated !!!

P.S: Sorry for my poor english...


Poster: Ruth
Dated: Monday September 13 2004 - 17:43:14 BST

Are you saying that what you call each 'menu' is actually a different menu or are they different main menu items of 1 menu?

As to the other, you might be able to write a javascript function to do what you want.

Ruth


Poster: Andy
Dated: Monday September 13 2004 - 18:03:55 BST

Hi,

Try adding the following to the top of your menu_data.js file.

Code:
retainClickValue=true;


-- Andy


Poster: kevin3442
Dated: Monday September 13 2004 - 18:29:48 BST

Hi,

Just to add...

tamagotchi wrote:
...the 4 others expand only on mouseover, not with click

Adding retainClickValue=true, as Andy said, should take care of that part. Combining that with using openonclick should do most of what you want. However, you should be aware that it will not take care of this:

tamagotchi wrote:
3) to close my menus I have to :
...
c> click anywhere else in the page.

To do that would require an event handler to detect clicks anywhere on the page that is not on a menu. As far as I know, the menu has no built-in method for this. In playing with it myself, I've found that (1) there are several cross-browser issues with such a handler and (2) trying to institute such a handler is a pain because it interferes with other "clickable" objects on a page (e.g., images, standard hyperlinks, etc.) If you make a good one, please let us know.

Cheers,

Kevin


Poster: tamagotchi
Dated: Tuesday September 14 2004 - 8:08:51 BST

Hi,

Thank for all your replies, it seems to work perfectly !

Kevin,
For the event handler for closing menu when click anywhere else on the page, that's not important, the closeDelay is working, and everything's right for me (and my boss !!) Even if people use to click anywhere else to close it, it closes when going out after a short delay, and people will think that their click has worked...

Thank you again, it very helps !!


Poster: Andy
Dated: Tuesday September 14 2004 - 12:03:29 BST

Kevin,

For the record, we added an onClick event to the document.body in verison 5.45 that will allow the menus to close when clicking elsewhere on the page.

Not sure if this will cause any problems with other stuff but it's still early days, may need to include a flag if anybody experiences any trouble with menus dissapearing when they shouldn't.

Just thought I'd let you know.

Cheers
Andy


Poster: kevin3442
Dated: Tuesday September 14 2004 - 18:27:17 BST

Hi Andy,
Andy wrote:
...For the record, we added an onClick event to the document.body in verison 5.45 that will allow the menus to close when clicking elsewhere on the page...Just thought I'd let you know.

Good deal... I put nothing past you. I assume it's only in mmenudom.js? Thanks for the heads up. I'm gonna give it a try.

Cheers,

Kevin


Poster: Andy
Dated: Wednesday September 15 2004 - 9:24:49 BST

Yeah, Netscape 4.x support is almost dead so not much point adding it. So it's only in mmenudom.js

FYI - milonic.com broke for Netscape 4.x recently and for about 3 weeks, we heard nothing, even the complaints about usual Netscape 4 problems have all but dried up.

Safe to say that it's dead and buried - well almost.

Now, if only we could figure out how can we destroy Internet Explorer for the Apple Mac :evil: :roll: :lol:

Cheers
Andy