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

Problem with menus getting smaller and smaller


Poster: coderanger
Dated: Friday September 3 2004 - 20:47:58 BST

I have created a test menu but every time i move the mouse back and forth over the top level menu headings, the menu width gets smaller and smaller.

Code:
with(menuStyle=new mm_style()){
onbgcolor="#FFFF00";
oncolor="#000000";
offbgcolor="#FFFFAA";
offcolor="#000000";
bordercolor="#FFFF99";
borderstyle="solid";
borderwidth=1;
separatorcolor="#ffffff";
separatorsize=1;
padding=3;
align="center";
fontsize=".80em";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
overfilter="Fade(duration=0.1);Alpha(opacity=95);";
}

with(milonic=new menuname("Main Menu"))
{
   style=menuStyle;
   alwaysvisible=1;
   itemwidth="100px";
   orientation="horizontal";
   
   aI("text=Home;url=/;status=Back To Home Page;");
   aI("text=Regulation;showmenu=Regulation1;");
   aI("text=Fixed;showmenu=Fixed2;");
   aI("text=Mobile;showmenu=Mobile3;");
   aI("text=Cable;showmenu=Cable4;");
}

with(milonic=new menuname("Regulation1"))
{
   style=menuStyle;
   itemwidth="100px";
   align="left";
   overflow="scroll";

   aI("text=CNC;url=http://www.cnc.gov.ar;");
   aI("text=SECOM;url=http://www.secom.gov.ar;");
}

drawMenus();


Poster: kevin3442
Dated: Friday September 3 2004 - 21:41:42 BST

Hi,

There's nothing in the code you posted that would cause the behavior you described. And when I test it locally, I don't get the behavior. What browser/OS are you using? What release of the menu (version number)?

Do you have a test URL we could look at to see the phenomenon in action? If not, can you post your test to an accessible url? Barring that, how about posting in here the full html from your test page, plus the full content of your menu_data.js, as well as any .css you're using.

Cheers,

Kevin


Poster: coderanger
Dated: Friday September 3 2004 - 23:05:58 BST

Ill post a url shortly as I am uploading the site later tonight, thanks


Poster: coderanger
Dated: Sunday September 5 2004 - 15:24:15 BST

http://emergingmarketinvestor.co.uk/country.asp?id=1


Poster: coderanger
Dated: Monday September 6 2004 - 18:00:31 BST

Sorry, has anyone looked at this as I need to secure that page on the site so only logged in customers can view it -- but I am waiting until someone from Milonic has seen it first.


Poster: Ruth
Dated: Monday September 6 2004 - 20:21:28 BST

No horizontal menu shows on the page when I go to it. I downloaded it and then copied your coding from the previous post into the menu_data.js file. I am not getting any problem like you mention uisng IE5.5, Win98se. We need to know which browser and OS you are using where this occurs.

Ruth


Poster: coderanger
Dated: Monday September 6 2004 - 20:23:14 BST

IE 6 Win XP Pro

and sorry, use this link:
http://emergingmarketinvestor.co.uk/cou ... id=1&mid=1


Poster: Ruth
Dated: Monday September 6 2004 - 20:36:24 BST

Thanks. I got it and it still is not showing the problem. I notice you have the menu in a table cell, however you do not have position="relative"; specified. If you are trying to center the menu in the table cell, you need to check the instructions for doing that. Embedding a Menu in a Table Cell

The only thing you put in the table cell is the main menu. The rest goes into the menu_data.js [all the submenus] That may be what is causing the problem.

Ruth


Poster: coderanger
Dated: Monday September 6 2004 - 20:42:03 BST

I cant put anything in menu_data as its a dynamic site, it needs to be dynamically generated and thus appears where it is. It should make no difference where the javascript is situated anyway.

And I am not trying to center the menu in the table cell, its position is fine, and it operates fine.

What happens is that if you scan the mouse from left to right over the menus so they popdown you will see the menus getting smaller and smaller. Hover over Regulation, move mouse right so Fixed pops down, then left over regulation again, then right over fixed. Keep doing this about ten times and you will that each drop down gets progressively smaller in width.

It does this everytime at home and work on XP Pro and XPPro SP2. If you cant reproduce this then I imagine I am not explaining what you need to do to reproduce the problem properly.

Oh and position="relative"; doesnt fix it and on the submenu it in fact stops the drop downs from appearing at all.


Poster: Ruth
Dated: Monday September 6 2004 - 20:59:10 BST

I still can't reproduce the problem, but I don't have that browser and OS, but I looked at it, and as a suggestion, try specifying the itemwidth in each item, see if that fixes the problem. I'm sorry I can't be of more help.

Ruth


Poster: coderanger
Dated: Monday September 6 2004 - 21:04:15 BST

I have an item width already on the submenus itemwidth="110px";

Does anyone at Milonic have this browser and OS? Could you ask them?


Poster: Ruth
Dated: Monday September 6 2004 - 22:40:51 BST

I will inquire. I know you have it specified in the submenus, I thought putting it in the actual item might fix the problem. There were some issues with netscape with regard to wanting the itemwidth in the item at one time.

Ruth


Poster: kevin3442
Dated: Tuesday September 7 2004 - 8:56:07 BST

Hi,

I see the problem in IE6/Win2k. It appears to be caused by the overflow="scroll" property. Try removing that from all of your menus, and see if the problem goes away.

Couple of other quick notes:
coderanger wrote:
Oh and position="relative"; doesnt fix it and on the submenu it in fact stops the drop downs from appearing at all.

position="relative" should only be applied to the main menu.

coderanger wrote:
I cant put anything in menu_data as its a dynamic site, it needs to be dynamically generated and thus appears where it is. It should make no difference where the javascript is situated anyway

Unfortunately, "should" is not always borne out by what really happens. Depending on what browsers you are targeting, it can make a tremendous difference. Some browsers (mainly older ones) object to having lots of script in tables. This is especially true of IE on Macs and NS4. Embedding the submenus in the table can also cause positioning problems for opening submenus in some browsers, because of variation across browsers in how container positions are derived. If you're just going for modern browsers, then no biggie. Even so, you could still put your submenu definitions in a menu_data.asp file, using ASP to generate the js code dynamically.

Cheers,

Kevin


Poster: coderanger
Dated: Tuesday September 7 2004 - 13:33:27 BST

Removing overflow worked fine. Thank you, but what would happen if I have a lot of menu items, wouldnt I not get a scroll bar ... if thats right what would happen?


Poster: coderanger
Dated: Tuesday September 7 2004 - 13:47:55 BST

Oh dear, just purchased my copy and I dont know what to do next, so i edited the milonic_src.js file and added my licence number and url to the code and now my menus dont work at all!!

Cool.


Poster: coderanger
Dated: Tuesday September 7 2004 - 14:03:29 BST

Its alright, I redownloaded it and its okay now, sorry.


Poster: Ruth
Dated: Tuesday September 7 2004 - 16:41:37 BST

That's correct, you would not get a scrollbar. You may be able to put that back if you use Kevin's suggestion of putting the submenus into a menu_data.asp file, using ASP to generate the js code dynamically. But, I don't know for sure, you would have to test it that way and see if the problem didn't occur with the overflow scroll functioning.

Ruth