Vertical Menu with 2 columns?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
skyblue
Beginner
Beginner
Posts: 5
Joined: Wed Feb 25, 2004 4:01 pm

Vertical Menu with 2 columns?

Post by skyblue »

Hi all,

Have anyone tried to create a vertical menu with 2 columns, meaning every row has 2 items instead of one.

Any guidelines or ideas will be highly appreciated.
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

A recent post involved 2 rows horizontal, its very similar although a couple of things to consider. With rows the width is going to change if the text is larger, placing one under or on top of the other.

If the itemwidth is larger than any text it should work by making one column, duplicating it with a new menu-name and adjust the top and left position.

Your first submenu is going to open on top of the 2nd column, top or left="offset=1"; will also adjust submenu position.

Give it a try if you think it will work for you.

maz
skyblue
Beginner
Beginner
Posts: 5
Joined: Wed Feb 25, 2004 4:01 pm

Post by skyblue »

Maz,

Thanks for the reply.
maz wrote: Your first submenu is going to open on top of the 2nd column, top or left="offset=1"; will also adjust submenu position.
maz
Sorry, but I cannot understand well what do you mean by that. Would you kindly explain more?

I did a crazy experiment, it is working on IE, but I'm not sure how well in others:

with(milonic=new menuname("programmi")){
style=menuStyle;
aI("text=<table><tr><td width=150><a href='link.php?id_link=1'>item 1</a></td><td><a href='link.php?id_link=2'>item 2</a></td></tr></table>;type=form");
aI("text=<table><tr><td width=150><a href='link.php?id_link=3'>item 3</a></td><td><a href='link.php?id_link=4'>item 4</a></td></tr></table>;type=form");
aI("text=<table><tr><td width=150><a href='link.php?id_link=5'>item 5</a></td><td><a href='link.php?id_link=6'>item 6</a></td></tr></table>;type=form");
aI("text=<table><tr><td width=150><a href='link.php?id_link=7'>item 7</a></td><td><a href='link.php?id_link=8'>item 8</a></td></tr></table>;type=form");
aI("text=<table><tr><td width=150><a href='link.php?id_link=9'>item 9</a></td><td><a href='link.php?id_link=10'>item 10</a></td></tr></table>;type=form");
}

Any pitfall?
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

That is very experimental, can you show a link?

To do it in a table you would use the menu_data normally, by making 2 main menus in the one menu_data.js file, then take out the main_menu_left and place it in a table, and main_menu_right in the next td. Leaving all the styles and submenus in menu_data.js

That should work well.

maz
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Skyblue,

You might want to check out this thread (the one with two rows that Maz referred to). The same two-row menu is duscussed again in this thread. Essentially, Tim wanted a long horizontal main menu with two rows of menu items. He did this by defining two, abutting single-row menus in his menu_data.js file. You could do the same thing, as Maz suggested, by defining two separate vertical menus, and placing them side-by-side so that they appear to be one menu from the user's point of view.

Your table approach should work, but it's cumbersome to set up and it'd be very difficult if not impossible to take advantage of some of the functionality of the menu... like separate mouseover effects for each link, opening a different submenu for each link, etc. I think you'd be better off following up Maz's suggestion.

Kevin
skyblue
Beginner
Beginner
Posts: 5
Joined: Wed Feb 25, 2004 4:01 pm

Post by skyblue »

Hi Maz and Kevin,

Unfortunately I'm developing on my pc without any server, I'm unable to show you a preview.

Agree with Kevin, my methods totally unintentionally "disabled" all the good features of this library. I can easily make a div with a table just show and hide, only that I'm kind of in a tide schedule and no time to write javascript for relative positioning the layer to an image, as it is very time consuming to check on every browsers around.

I might try the idea of the example of two rows, only that I need to create 12 milonic menu to show 24 items, kind of messy as well...

Elsie
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Elsie,
skyblue wrote:...I might try the idea of the example of two rows, only that I need to create 12 milonic menu to show 24 items, kind of messy as well...
I think you misunderstand. We are not suggesting that you create multiple rows. We are only using Tim's recent approach as an example. He wanted a horizontal menu with two rows, each row with 7 items for a total of 14 menu items. The solution was to create two horizontal menus, each with 7 items, and stick them together to form one functional menu. We only mention this because it is similar to your dilemma, and the solution is similar, but the orientation is reversed.

A milonic menu can be either horizontal or vertical; in your terminology this would be horizontal = one row, vertical = one column. If you want what appears to be a single menu that has 12 rows of 2 columns each, you would not create 12 horizontal menus, each having 2 items (although you could if you wanted to). Instead, you'd create 2 vertical menus, each having 12 items... much more direct. It'd be very easy to do.

Kevin
skyblue
Beginner
Beginner
Posts: 5
Joined: Wed Feb 25, 2004 4:01 pm

Post by skyblue »

Ahh, stupid me, didn't think of the other way round... :oops:

Actually I tried that in the very beginning...now I explain a bit better:

I made two vertical menu like you said, each has multiple rows.

The problem is I use an image as a reference point (as in sample: Using the popup Positioned by Images.) I'm unable to popup two menu at the same time, have I done something wrong, or it is the limitation?

Elsie
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Elsie,
skyblue wrote:...The problem is I use an image as a reference point (as in sample: Using the popup Positioned by Images.) I'm unable to popup two menu at the same time, have I done something wrong, or it is the limitation?
I'm not sure I completely understand. Are you saying that when you mouseover or click on an image, you want your "double-menu" to pop up? If so, that should be do-able through a little bit of scripting.

Kevin
skyblue
Beginner
Beginner
Posts: 5
Joined: Wed Feb 25, 2004 4:01 pm

Post by skyblue »

I'm not sure I completely understand. Are you saying that when you mouseover or click on an image, you want your "double-menu" to pop up? If so, that should be do-able through a little bit of scripting.
Yes, that was what I meant. I call popup twice under the event of mouseover, but only the first one was shown. Any workaround?
Post Reply