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: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:28

Menu widths not correct


Poster: Pico
Dated: Tuesday June 17 2003 - 18:15:25 BST

I was wondering if anyone had any idea what would cause this:

I am using v 3.5.15 of the menu. I only have one script running the menu. The problem that I am having, is that it displays entirely correct in Netscape, and only partially correct in IE and Opera. The problem in IE and Opera is different.

In IE, the problem shows up on every page except the main page which the submenus' highlight and border don't get cut off at the appropriate length as they do in the main page.

In Opera, the problem is slightly different, in that it adds an extra space in each submenu item cell.

Here is a snippit from the menu_array.js file that I am using:

Code:
addmenu(menu=["SUPPORT",
    ,,160,1,,XPMenu,0,,,
    0,0,0,,,0,0,,,0,"margin=2",
    ," Common Questions","# onbordercolor=316AC5;offbordercolor=99CCFF;",,"Support :: Common Questions",0
    ," Help & Support","# onbordercolor=316AC5;offbordercolor=99CCFF;",,"Support :: Help & Support",0
    ," Online Documentation","# onbordercolor=316AC5;offbordercolor=99CCFF;",,"Support :: Online Documentation",0
    ]);


I have played around with the code as many ways as I can think that might affect it, but to no avail. I tried downloading a newer version of mmenu.js, double checking for closed strings and the right number of commas, I even recreated my menu using the Menu Builder.

Any input is greatly appreciated.


Poster: Pico
Dated: Tuesday June 17 2003 - 18:22:56 BST

I forgot to post the url where you can view the problems, here they are:

http://www.acsurf.net/jobs/default.php (correct display)
http://www.acsurf.net/jobs/lost_password.php (incorrect display)

Thanks for your time.


Poster: kevin3442
Dated: Wednesday June 18 2003 - 0:50:28 BST

Hi Pico,

Hmmm... It's odd that the submenu width on the page that works is actuall 167, even though you've specified 160. On the page that doesn't work, the submenu width is actually 160, which would explain why the right side is getting clipped. Now, why the difference? Don't know yet myself, but I might find it. Meantime, try adjusting your menu width to 167 (or higher) and see what happens...

Kevin


Poster: Pico
Dated: Wednesday June 18 2003 - 14:18:34 BST

Quote:
Meantime, try adjusting your menu width to 167 (or higher) and see what happens...


I did actually try adjusting the size, both to a size larger than the 160 (165, 175, 200) and without a size specified, both to no avail. I really do appreciate the time you are putting into this.

Menu Width diffference in IE and Netscape


Poster: Non
Dated: Thursday July 3 2003 - 12:39:17 BST

I also noticed a difference in the way the menu width is handled bij Netscape and IE:
I set the menu width to 77 pix. Netscape makes every main menu 'button' the same size, but IE makes the main menu buttons wider that contain more text than what will fit in 77 pix. If the text fits in, the menu is 77 pix.

In my case, this causes a nice lay-out in IE, but cut off and overlapped (by the down arrow gif) text in Netscape.

URL: http://www.hmz.nl

If anyone knows a solution to this, I'll be glad to hear it!


Poster: kevin3442
Dated: Tuesday July 8 2003 - 8:55:02 BST

A couple of suggestions: Try not setting a width at all in your mainmenu. The menu system will attempt to set a width for each menu item, based on the text in each item. You'll notice some "squeezing" on some of your items that have submenus. Note that the items you've padded at the end with a couple of  's don't get squeezed, but the ones you haven't padded do get squeezed. So, place some non-breaking spaces at the end of each item that opens a submenu.

Another approach would be to (1) not specify a width, as mentioned above, (2) remove arrowdn.gif from the 17th element of the style1 array, (3) you won't have any "down arrows" in your main menu now, so you could insert them in the appropriate items manually, using an <img> tag, like so:
Code:
,"HMZ&nbsp;info&nbsp;<img border=0 src=arrowdn.gif>","show-menu=hmz","http://www.hmz.nl/hmz/index.htm","",1

Because the down arrow is part of the html in the menu item, it should be taken into account when the menu system figures out the width for that item, so you shouldn't get any squeezing.

Hope that helps,

Kevin


Poster: Non
Dated: Tuesday July 8 2003 - 9:45:16 BST

Quote:
A couple of suggestions

Thanks Kevin, you wrote a nice 'usermanual' for me! Since I am quite new to this menu, this information is very welcome, and I will try it as soon as I can (a little busy with other things at the moment). I will post a message as soon as I changed the menu in the way you suggest.

Nadia