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

Multiple Coloured Menu Padding


Poster: Tessa
Dated: Saturday May 29 2004 - 4:06:57 BST

I am wanting to (I think) pad the menu items, so that the four main menu items I have, fill up the width of the screen, rather than squashed up in the centre with white to the left and right of these. You can see what I mean at http://www.skycabs.co.nz/test.htm

Could someone please let me know what I need to type in these to get it this way?

Thanks

Tessa


Poster: Ruth
Dated: Saturday May 29 2004 - 4:48:58 BST

If you insert itemwidth="100%"; in the same place you have menuwidth="100%" the items will expand each taking 25% of the page.

Ruth

Multiple Colour Menu


Poster: Tessa
Dated: Sunday May 30 2004 - 23:27:23 BST

Thanks Ruth for that. Now, how do I get the headings to centre within their item? At present, they are left aligned.

I may actually want to alter the width of the submenus too, so that they match the width of their category they're coming from - what do I type in for each of the sub menus?

And if I want to, can I centre these headings too?

Other than that, looks like I'm away!

Thanks again


Poster: Ruth
Dated: Monday May 31 2004 - 1:44:29 BST

in the menuStyle definition at the top of the data file put in align="center"; that aligns the text to the center of the menu item. If you put it there it will align all text for any menu that uses that style to the center. As to expanding the width of the submenus, since you are using menuwidth="100%" there is no way to figure that out. what you could do is get rid of the menuwidth 100% and instead make the itemwidth=180; and put in screenposition="center"; what that would do is put the menu in the center of that blue Skycabs section no matter what size the browser was. If you do that then you set each submenu to 180 also.

Ruth

Submenus visibility


Poster: Tessa
Dated: Friday June 4 2004 - 6:08:54 BST

Hey Ruth,

Are you able to help me with this? In the multiple colour menu I have used in http://www.skycabs.co.nz that you have already helped me with, my client wants the submenus to stay visible while within that specific category. If you have a look at the site, you will know what I mean. Eg, while in any of the pages in the green section, he wants that green submenu to be visible.

Is this possible and if so, how?

Thanks

Tessa


Poster: Ruth
Dated: Saturday June 5 2004 - 0:46:56 BST

Yes, it's possible. You have four colored sections. So, you make a menu_data.js file for each. Take the menu_data.js file you have now and save it four times, I'd name them blue.js, green.js, orange.js, red.js Then, for example, in the blue.js file code ALL the submenus that have to do with the blue section with alwaysvisible=1; by all I mean if you have submenus that come off the submenu you have to do those also. Leave everthing else as it is. Do that for each file, coding the submenus that go with the particular section with alwaysvisible=1;. Then code all the pages for each section to call the particular file that belongs to the section. So, in the blue section there are three pages, they would need the following in the head of the document, using your own paths, of course.
Code:
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>   
<script   language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");      
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="blue.js" type=text/javascript></SCRIPT>

Green would have that but green.js instead of blue and so on.

I'm sure there is some javascript code that could be written to 'read' which page is active and show the right menu, but I do not know how to do js code and this works just fine.


Ruth

Showing the submenus visibility


Poster: Tessa
Dated: Monday June 7 2004 - 5:13:44 BST

Hi Ruth,

Thanks, but the visibility of the submenus is always at the top lefthand corner. I have done all what you told me to do, although I did wonder where the alwaysvisible should go - I put in each submenu's details, not where the style of them is at the top of the menu. Does this make a difference? How do I show them above their correct sections off the main menu bar? I realise that I can put in top=170 to bring them down to the menu bar, but just need to know how to get them in the right position above each.

We're getting there. I haven't uploaded the changes to the net yet as I don't want the customer seeing it this way! Hope to hear from you soon! You've certainly been very helpful so far.

submenus again


Poster: Tessa
Dated: Monday June 7 2004 - 5:20:38 BST

Sorry, but I was checking it again and it may be looking funny as I am just viewing it on my pc at present. It could be okay once I upload but could you just confirm this to me before I do?

Thanks


Poster: Ruth
Dated: Monday June 7 2004 - 7:45:35 BST

Confirm what? You put the alwaysvisible=1; in the menu, just like you do for the main menu, not in the global style...in the same place you put orientation="horizontal"; Can you upload to a test site so I can check it before you put it up?

Ruth

Submenus visibility


Poster: Tessa
Dated: Monday June 7 2004 - 20:18:33 BST

I have uploaded it all and have advised the client that he is to bear with me while I correct the problem!!

If you have another look through the site, you will see the mess! http://www.skycabs.co.nz

Somehow I need to get those submenus down to where they should be!

Also, there are three headings in the main menu that need their link taken off ie, not to appear as a link. I thought I had but it still shows it is a link.

Tessa


Poster: Ruth
Dated: Tuesday June 8 2004 - 2:52:12 BST

Ok, I will work on it, and have something for you by tomorrow early....It's 9:45pm Monday night right now.

Ruth


Poster: Ruth
Dated: Tuesday June 8 2004 - 10:07:04 BST

Hi Tessa,
I've hit some problems. I'm still working on it, but for now I suggest you go just put one main data.js file on the site with the mouseover for the submenus while I try and find a solution. A number of things come up when trying to do this.

1. When you set the menu to alwaysvisible=1 it is no longer a 'submenu' in the sense that it doesn't function like one does on mouseover, so you have to set the position. That will work fine if you specify a menu width, but setting it to 100% and centering it means it will change position with the size of the browser. If you want to set the width to 770 which would be about right for 800x600 resolution and that table you have just below it with the colored line that is set at 800, then it won't be hard to set the position of the submenus.

2. If you want to keep it as it is, then this is the problem I'm encountering: To achieve what you want, you have to put the menu in a table. It works fine, but although you seem to be using a template, the top section, which I assumed was the same size is not, on some pages it's 75px high, on some it's 132, othrs 134, up to 143. That means I have to try and figure out just how 'high' to make the table to get the menu to sit on top of the colored bar. Then in some cases there's not enough room without moving the bar down. So, I tried putting an extra table rows into the table that has that colored bar, but again, that will shift it, depending on how high the top section is. Added to this, on some of the pages you have one table
Code:
<TABLE cellSpacing=0 cellPadding=0 width=800 border=0>
  <TBODY>
  <TR>
    <TD class=bodytype vAlign=bottom><!-- #BeginEditable "ContentText" --><!-- #EndEditable --></TD></TR></TBODY></TABLE>
and on other pages you have two of those one right after the other. So, I'm having difficulty getting the menu to sit where it's supposed to be. Unlike when you just put it on the page, if you put it in a table the position has to be set to 'relative'; so it sits where the table is, well that works fine if the submenus are functioning as submenus, but when you make them alwaysvisible they cause the table to be expanded the height necessary to accomodate that submenu in the table cell. That of course shifts everything down.

I am working on it to see if I can get a solution, I WILL put something up today, for you to see and decide if you want to use it, but as you can see it's now 5am and I thought I'd have something up hours ago.

I just wanted to tell you that you should probably put it with a regular menu_data.js file that just uses submenus for today, that would look much better until I figure out a solution.

Ruth


Poster: Ruth
Dated: Tuesday June 8 2004 - 16:23:58 BST

Ok, Tessa, I did get a way to do it. I don't know if you can use it or not. Hope it helps. There are 4 new data files, one of the problems you had was you kept the showmenu in the line for the ones that were being made alwaysvisible. Anyway, let me know if this helps or if it needs some tweaking and I'll try, and post here when you get them so I can remove them from my site.

Alwaysvisible submenu designs

Ruth

Submenus


Poster: Tessa
Dated: Tuesday June 8 2004 - 20:09:28 BST

Thanks Ruth for your hard work on this. Hope you're getting paid for it!

I have left the site as is for now as I have informed the client about it, so I won't make anymore changes until I hear back from you.

The problem I had with this whole site in the first place was that it was designed by another designer who used a different program to me, hence the odd scripts etc that are in the pages.

I am quite sure that it is why some of the tables are not lining up correctly. I have worked on this a lot and it has driven me nuts! I set them to be 100% width so that they can be viewed correctly on both 800x600 and 1024x768. The latter is the view the client wants, not 800x600.

I am not totally sure what you mean about the 'showmenu' as I can't see anything there that is not right. Can you please explain when you've had some sleep?!

It's a pity about the time difference as I am in NZ and we are about 11 hours ahead but I have really appreciated your help on this.


Poster: Ruth
Dated: Tuesday June 8 2004 - 22:46:58 BST

I just did with your thanks :). We are volunteers who just really really like Milonic menu and everything I play with teaches me something.

As to the thing about showmenu: in the red.js file, the item that has showmenu= and refers to that submenu is what you remove, same in all the others, blue in the blue, etc. That's because you have the submenu set to always visible, it's already there, so you don't need showmenu=.

*****Now as to this workaround, which is what it is. Don't spend too much time on it, unless maybe you just want to see how it was done. I believe another volunteer, Kevin, our js guru, has a much simpler solution for this. :D and the weird layout with the top of the page being different sizes on so many pages won't make a difference in this method. I think.


Ruth

Submenus


Poster: Tessa
Dated: Wednesday June 9 2004 - 0:32:28 BST

Wow, what a great volunteer!

Anyway, how do you get to see the files at your end anyway?

I am not at home (where my usual office is) at the moment, so can't quite see what you're talking about.

The showmenu I sort of understand but I remember that there is only one section where the showmenus are. Do I take out all of those showmenus, or just the one relating to the submenu relevant to each section? I hope I make sense here?!

Tessa


Poster: Ruth
Dated: Wednesday June 9 2004 - 1:15:36 BST

Hi Tessa,
I go to the page using IE, click on file, then save as and save it. Any files that don't get downloaded, usually images inside the menu, I go to my temp internet files and copy them.

As to the showmenus. The main menu has SkyCabs showmenu=Samples, those are the blue ones, so in the blue file, remove the showmenu=samples from it. Then with Global Case Studies; showmenu=Milonic so from the red file, remove that showmenu, and so on with the four colored data files.

Ruth

Submenus


Poster: Tessa
Dated: Wednesday June 9 2004 - 2:17:18 BST

Okay, gotcha. I thought it was something like that. :D I will let you know how I get on. Fingers crossed.

Submenu disaster!


Poster: Tessa
Dated: Wednesday June 9 2004 - 19:50:34 BST

Hi Ruth,

Well, that was a disaster! I have put it back to how it was in the meantime, because I just couldn't leave it like that. For each section it showed only three colours in the main menu across the page with the submenu of the missing colour up in the lefthand corner again. :oops: Embarrassing if the client saw it.

Now, for instance, I what I did was in the blue menu, I took about this only:

aI("text=SkyCabs;url=http://www.skycabs.co.nz;status=Your Destination, Our Goal;showmenu=Samples;oncolor=#ffffff;offcolor=#ffffff;offbgcolor=#38A4D5;onbgcolor=#38A4D5;");

Then, I realised I had taken too much out, and then proceeded to take showmenu=Samples; only.

This is still showing the same way as yesterday and is now driving me absolutely nuts as I just have to get this right. And unfortunately, my client is one of those control freaks and what could have gone wrong has gone wrong with this site! :cry:

What do we do now?


Poster: kevin3442
Dated: Wednesday June 9 2004 - 21:06:31 BST

Hi Tessa,

This is actually a tough one. You're essentially asking the menu to do something it isn't really designed to do. By setting the submenus to alwaysvisible=1, you're telling the system to display the submenu when the page loads. It'll do that, as you can see, but the submenu doesn't have a location to open in yet (because, in your case, its initial appearance isn't being triggered by mousing over a main menu item). Without a location to use, the menu system therefore opens the menu at 0,0 (upper left corner). The trick of course is to open the submenu at a position corresponding to the main menu item that normally triggers it. The Catch 22 is that, with the positioning of your main menu, we don't know where that item will be until the page renders. If you don't know where the item is, how can you gibe the submenu a position?

So... here's an alternative.

(1) Combine all of your menu definitions back into one menu_data.js file (hopefully, you still have it from earlier). In each submenu, set
Code:
top=-999;
left=0;
alwaysvisible=1;

The alwaysvisible setting will make the menu system display all four submenus when each page loads, but the top=-999 setting will make them display well off of the visible area (the user won't see them). That way, each submenu is opened when the page loads... we need that so we can get the dimensions of each menu (mainly the height), to figure out what coordinates to move the appropriate submenu to above the main menu. After we get the dimensions, we will disable alwaysvisible=1, transforming each submenu into a normal one. Once that's done, we'll essentially figure out which submenu should be open, and reposition it to the proper location (above its normal trigger item in the main menu).

(2) To do all of this, I have three functions for you to add to the top of menu_data.js... you can just copy the following code and paste it into the top of your menu_data.js file.
Code:
function openUrl(url)
{
  url+="?"+_itemRef;
  window.location = url;
}

function resetSubmenus()
{
  for (i = 1; i < _m.length; i++)
  {
    if (_m[i][7]) {
      _m[i][7] = 0;
      _m[i][3] = null;
      _m[i][2] = null;
    }
  }
}

function autoOpenSubmenu()
{
  topOffset = -1;
  resetSubmenus();

  passedParam = location.search.slice(1);
  clickedItemNum = passedParam * 1;
  mainItemNum = getParentItemByItem(clickedItemNum);
  itemPosArr = gpos(gmobj("el" + mainItemNum));
  menuName = _mi[mainItemNum][3];
  menuObj = gmobj("menu" + getMenuByName(menuName));
  menuPosArr = gpos(menuObj);
  menuPosArr[0] = itemPosArr[0] - menuPosArr[2] + topOffset;
  menuPosArr[1] = itemPosArr[1];
  spos(menuObj,menuPosArr[0],menuPosArr[1]);
  popup(menuName);
}


(3) In your home page, add the following inside the <body> tag:
Code:
onload="resestSubmenus()"


(4) You'll notice that one of the functions you added to menu_data.js is named openUrl(). This is the function that you will use from now on to open a new page. So, instead of doing it like this:
Code:
aI("text=Item Text;url=pageName.htm;");

You'll do it like this:
Code:
aI("text=Item Text;url=javascript:openUrl('pageName.htm');");

the openUrl() function adds the "item reference" number for the menu item that is clicked, and passes that to the next page. The next page then does some additional magic with that number.

(5) In all of your pages that you want to automatically open the correct submenu, you have to add the following code inside of the <body> tag
Code:
onload="autoOpenSubmenu()"

The autoOpenSubmenu() function takes the item reference that was passed from the previous page, figures out which item was clicked on the previous page, then figures out the location and dimensions of the item as a reference point. It also uses the clicked item reference to figure out which submenu should be automatically opened. It then gets the current location and dimensions of that submenu, and resets the coordinates (remember it is currently hanging out a -999,0) to the correct location, while also making it no longer alwaysvisibe (so it'll behave as a normal submenu).

The autoOpenSubmenu() function contains a variable called topOffset which is currently set to -1. This essentially applies a fine-tune adjustment to the final location of the submenus when they are automatically opened. The idea is to get that position to match the position that they would normally open in when mousing through the main menu. you may have to change the -1 to -2 or so, but I doubt it.

You can see a working example here. You can also download a copy to play with locally. I tried to set it up similarly to your site's layout. You can still apply the colors and various styles that you use in your own implementation.

Hope that works out for you.

Kevin

Submenus


Poster: Tessa
Dated: Thursday June 10 2004 - 4:22:29 BST

Thanks Kevin for all that. A lot to digest! I have just looked at your example and when you click on a submenu item, that submenu still doesn't appear to be staying put. ie, as soon as you move the mouse off that submenu, it goes again. I am wanting the submenu (while in that particular section whether it be 2 or more pages for each section) to stay popped up, so that the visitor can always see the other pages for that section instead of just the mouse-over.


Poster: Ruth
Dated: Thursday June 10 2004 - 5:24:14 BST

Tessa, Kevin's is the much better way to do it, much cleaner using the js functions.

As to why yours was all messed up, I don't know. If you can put up one page someplace as a test that you had up I can check it if you want to know, but using Kevin's would be a lot easier I think. Then you dont' have to mess with tables and such. I won't be able to check anything for a couple of days.

Ruth

Re: Submenus


Poster: kevin3442
Dated: Thursday June 10 2004 - 8:35:22 BST

Hi Tessa,

Tessa wrote:
...when you click on a submenu item, that submenu still doesn't appear to be staying put. ie, as soon as you move the mouse off that submenu, it goes again...

Sorry 'bout that. I guess I didn;'t read enough of the previous posts to get that part of it. I thought you just wanted the submenu to open automatically when the page opened, but then close again as a normal submenu when one of the others opened. No problem though at this point... just a few changes in the main function. Here's an updated autoOpenSubmenu() function; use it instead of the one in my previous Post (I took the opportunity to tighten it up some too, so I believe the new version is actually a little smaller).
Code:
function autoOpenSubmenu()
{
  topOffset = -1;
  resetSubmenus();
  clickedItemNum = location.search.slice(1);
  mainItemNum = getParentItemByItem(clickedItemNum);
  clickedItemPos = gpos(gmobj("el" + mainItemNum));
  menuNum = getMenuByItem(clickedItemNum);
  menuObj = gmobj("menu" + menuNum);
  menuPos = gpos(menuObj);
  menuPos[0] = clickedItemPos[0] - menuPos[2] + topOffset;
  menuPos[1] = clickedItemPos[1];
  spos(menuObj,menuPos[0],menuPos[1]);
  _m[menuNum][7] = 1;
  popup(_mi[mainItemNum][3]);
}


I've also updated the on-line example, as well as the downloadable .zip. Let us know how it goes.

Kevin

Submenus


Poster: Tessa
Dated: Thursday June 10 2004 - 20:17:40 BST

Hi Kevin,

Thanks heaps for that. Your example page is exactly what I want. I will be working on this either today or tomorrow, the soonest I can get to it!

Will let you know.

Tessa

Submenus


Poster: Tessa
Dated: Friday June 11 2004 - 8:55:54 BST

Kevin,

Could you please have a look at the site again. I have gone back to the menu_data.js file and pasted in your latest code, then I added onload="resetSubmenus()" in the home page as per your third instruction, but this as far as I have got as I am not quite sure what to do next. In your fourth instruction, do I have to put in url=javascript:openUrl('pagename.htm');); ?? And with the pagename, do I put in the whole url ie, http://www.skycabs.co.nz/index.htm, or just the file name - index.htm, or http://www.skycabs.co.nz/index.htm. Please let me know.

And in your fifth instruction, do I put that code in each and every page? That part I am a bit confused on too.

Thanks

Tessa

Re: Submenus


Poster: kevin3442
Dated: Saturday June 12 2004 - 0:14:41 BST

Hi Tessa,

Tessa wrote:
...In your fourth instruction, do I have to put in url=javascript:openUrl('pagename.htm');); ?? And with the pagename, do I put in the whole url ie, http://www.skycabs.co.nz/index.htm, or just the file name - index.htm, or http://www.skycabs.co.nz/index.htm....

You can put it just like you would if you were using the url= property in a standard aI() definition. So, if you would normally define a menu item like this:
Code:
aI("text=Products;url=/products/productlist.htm;");

then "our" method would be:
Code:
aI("text=Products;url=javascript:openUrl('/products/productlist.htm');");

I'd also note that you shouldn't have to include the full domain, etc. In other words, if you would use a url of http://www.skycabs.co.nz/index.htm then a url of /index.htm should do the same (assuming that http://www.skycabs.co.nz is your site).

Tessa wrote:
...And in your fifth instruction, do I put that code in each and every page?

You need to add the onload code inside the <body> tag on any page where you want the corresponding submenu to open automatically. If you have a page where you don't want the submenu to open, then leave the onload code out.

Hope that helps,

Kevin

Submenus again


Poster: Tessa
Dated: Sunday June 13 2004 - 4:53:01 BST

Hi Kevin,

Still having trouble I'm afraid and I suspect it's because there are the original codes plus yours that are clashing. Below is the whole menu that I have pasted here to show you what I did. I also put the onload='autoOpenSubmenu()" in all pages but the home page. For now, I have put the site back to how it was, but below is what I did following your instructions. Please let me know what I have done wrong. :roll:

function autoOpenSubmenu()
{
topOffset = -1;
resetSubmenus();
clickedItemNum = location.search.slice(1);
mainItemNum = getParentItemByItem(clickedItemNum);
clickedItemPos = gpos(gmobj("el" + mainItemNum));
menuNum = getMenuByItem(clickedItemNum);
menuObj = gmobj("menu" + menuNum);
menuPos = gpos(menuObj);
menuPos[0] = clickedItemPos[0] - menuPos[2] + topOffset;
menuPos[1] = clickedItemPos[1];
spos(menuObj,menuPos[0],menuPos[1]);
_m[menuNum][7] = 1;
popup(_mi[mainItemNum][3]);
}
_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_subOffsetTop=5 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset



with(menuStyle=new mm_style()){
//onbgcolor="#4F8EB6";
oncolor="#ffffff";
offbgcolor="white";
offcolor="#515151";
bordercolor="#296488";
ondecoration="underline";
borderstyle="solid";
borderwidth=0;
separatorcolor="#2D729D";
separatorsize="0";
separatorwidth="60";
padding=5;
fontsize="80%";
fontstyle="normal";
fontweight="bold";
fontfamily="Arial";
align="center";
pagecolor="black";
//pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.3)";
}

with(EasySampleStyle=new mm_style()){
onbgcolor="#38A4D5";
oncolor="#ffffff";
offbgcolor="#38A4D5";
offcolor="#FFFFFF";
bordercolor="#000000";
ondecoration="underline";
borderstyle="solid";
borderwidth=0;
separatorsize="0";
padding=5;
fontsize="12px";
fontstyle="normal";
fontweight="normal";
fontfamily="Arial";
}

with(MilonicStyle=new mm_style()){
onbgcolor="#E60078";
oncolor="#ffffff";
offbgcolor="#E60078";
offcolor="#FFFFFF";
bordercolor="#000000";
ondecoration="underline";
borderstyle="solid";
borderwidth=0;
separatorsize="0";
padding=5;
fontsize="12px";
fontstyle="normal";
fontweight="normal";
fontfamily="Arial";
}

with(PartnersStyle=new mm_style()){
onbgcolor="#009B7C";
oncolor="#ffffff";
offbgcolor="#009B7C";
offcolor="#ffffff";
bordercolor="#000000";
ondecoration="underline";
borderstyle="solid";
borderwidth=0;
separatorsize="0";
padding=5;
fontsize="12px";
fontstyle="normal";
fontweight="normal";
fontfamily="Arial";
}

with(LinkStyle=new mm_style()){
onbgcolor="#F47919";
oncolor="#ffffff";
offbgcolor="#F47919";
offcolor="#ffffff";
bordercolor="#000000";
ondecoration="underline";
borderstyle="solid";
borderwidth=0;
separatorsize="0";
padding=5;
fontsize="12px";
fontstyle="normal";
fontweight="normal";
fontfamily="Arial";
}


with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=170;
alwaysvisible=1;
itemwidth="100%";
menualign="center";
orientation="horizontal";
aI("text=SkyCabs;url=javascript:openUrl('http://www.skycabs.co.nz');status=Your Destination, Our Goal;showmenu=Samples;oncolor=#ffffff;offcolor=#ffffff;offbgcolor=#38A4D5;onbgcolor=#38A4D5;");
aI("text=Global Case Studies;showmenu=Milonic;oncolor=#ffffff;offcolor=#ffffff;offbgcolor=#E60078;onbgcolor=#E60078;");
aI("text=Global Potential;showmenu=Partners;oncolor=#ffffff;offcolor=#ffffff;offbgcolor=#009B7C;onbgcolor=#009B7C;");
aI("text=Contact Us;showmenu=Links;oncolor=#ffffff;offcolor=#ffffff;offbgcolor=#F47919;onbgcolor=#F47919;");
}

with(milonic=new menuname("Samples")){
style=EasySampleStyle;
overflow="scroll";
openstyle="up";
aI("text=Product Description;url=javascript:openUrl('http://www.skycabs.co.nz/Product.htm');status=Product Description;");
aI("text=Advantages;url=javascript:openUrl('http://www.skycabs.co.nz/Advantages.htm');status=SkyCabs Advantages;");
aI("text=Environment;url=javascript:openUrl('http://www.skycabs.co.nz/Environment.htm');status=In Harmony with the Environment;");
}

with(milonic=new menuname("Milonic")){
style=MilonicStyle;
openstyle="up";
aI("text=SkyCabs for Auckland;url=javascript:openUrl('http://www.skycabs.co.nz/Auckland.htm');status=SkyCabs for Auckland;");
aI("text=Global Rail Examples;url=javascript:openUrl('http://www.skycabs.co.nz/railexamples.htm');status=Global Rail Examples;");
}

with(milonic=new menuname("Partners")){
style=PartnersStyle;
openstyle="up";
aI("text=New Solutions;url=javascript:openUrl('http://www.skycabs.co.nz/newsolution.htm');status=New Solution;");
aI("text=Market Potential;url=javascript:openUrl('http://www.skycabs.co.nz/marketpotential.htm');status=Market Potential;");
aI("text=Target Market;url=javascript:openUrl('http://www.skycabs.co.nz/targetmarket.htm');status=Target Market;");
aI("text=Industry Comparison;url=javascript:openUrl('http://www.skycabs.co.nz/industrycomparison.htm');status=Industry Comparison;");
}

with(milonic=new menuname("Links")){
style=LinkStyle;
openstyle="up";
aI("text=About Us;url=javascript:openUrl('http://www.skycabs.co.nz/aboutus.htm');status=About SkyCabs - Our Company;");
aI("text=Your Interest;url=javascript:openUrl('http://www.skycabs.co.nz/your details.htm');status=Your Interest and Contact Details;");
}



drawMenus();


Poster: kevin3442
Dated: Sunday June 13 2004 - 5:51:13 BST

Hi Tessa,

Tessa wrote:
...I suspect it's because there are the original codes plus yours that are clashing...below is what I did following your instructions.

I see that you've got the modified version (second one posted) of the autoOpenSubmenu() function in your menu_data.js file. Good. However, if you review instruction 2 in my original post, you'll note that there are two other functions that you need to put in menu_data.js: openUrl() and resetSubmenus(). These two functions are missing from the menu_data.js code you posted, so I'll assume that they are not currently in the file. You need all three functions, openUrl(), resetSubmenus(), and autoOpenSubmenu() at the top of your menu_data.js file. openUrl() is the function that you call from a menu item to go to a new page; without it, your menu items simply won't do anything (except generate an "object expected" js error).

So, just to be absolutely clear, and also so that you don't have to go to the other message to get the code for the two missing functions... make sure that all of the following code is at the top of your menu_data.js file.
Code:
function openUrl(url)
{
  url+="?"+_itemRef;
  window.location = url;
}

function resetSubmenus()
{
  for (i = 1; i < _m.length; i++)
  {
    if (_m[i][7]) {
      _m[i][7] = 0;
      _m[i][3] = null;
      _m[i][2] = null;
    }
  }
}

function autoOpenSubmenu()
{
  topOffset = -1;
  resetSubmenus();
  clickedItemNum = location.search.slice(1);
  mainItemNum = getParentItemByItem(clickedItemNum);
  clickedItemPos = gpos(gmobj("el" + mainItemNum));
  menuNum = getMenuByItem(clickedItemNum);
  menuObj = gmobj("menu" + menuNum);
  menuPos = gpos(menuObj);
  menuPos[0] = clickedItemPos[0] - menuPos[2] + topOffset;
  menuPos[1] = clickedItemPos[1];
  spos(menuObj,menuPos[0],menuPos[1]);
  _m[menuNum][7] = 1;
  popup(_mi[mainItemNum][3]);
}

You can copy it right from here and paste it directly into your menu_data.js file.

Hope that helps,

Kevin

Submenus


Poster: Tessa
Dated: Sunday June 13 2004 - 19:46:45 BST

Hi Kevin,

Thanks got that. What I did was pasted your new one thinking that was it, but of course deleted the first two.

Now, if you look at the site http://www.skycabs.co.nz, you will see it is still not doing it. It is how it was ie, the submenus not staying up within each section how you had on your demo.

Did you go through my whole menu_data making sure I hadn't put the other codes in wrong? Maybe I've got the codes wrong in the actual pages.

Please have a look again and let me know. You certainly are being very helpful and I really appreciate it.

Tessa

Re: Submenus


Poster: kevin3442
Dated: Tuesday June 15 2004 - 6:17:04 BST

Hi Tessa,
Tessa wrote:
...Did you go through my whole menu_data making sure I hadn't put the other codes in wrong? Maybe I've got the codes wrong in the actual pages....

I admit that I didn't go through all of your code. After seeing the last problem, I just figured that was it. Looking at it more extensively now, I see some more problems:

(1) You forgot to add some code to the submenus. From the original instructions, step 1:
kevin3442 wrote:
(1) Combine all of your menu definitions back into one menu_data.js file (hopefully, you still have it from earlier). In each submenu, set
Code:
top=-999;
left=0;
alwaysvisible=1;

You have to add the above three lines of code to each submenu.

(2) In the code for your home page, you have:
Code:
<body background="images/background1.jpg" bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<onload="resetSubmenus()">
<onload="autoOpenSubmenu()">

There are two problems with this, regarding step 3 from the original instructions:
Quote:
(3) In your home page, add the following inside the <body> tag:
Code:
onload="resestSubmenus()"

First, you only need to use resetSubmenus() on the home page, not autoOpenSubmenu(). Second, the onload setting goes inside the <body> tag itself. You currently have it outside of the tag. So, remove the two onload lines that you have below the body tag, and put the onload setting for resetSubmenus() inside the body tag. You code (from above) would become this:
Code:
<body background="images/background1.jpg" bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0" onload="resetSubmenus()">


(3) You have a similar problem in calling autoOpenSubmenu() on your other pages. You currently have
Code:
<body background="" bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<onload="autoOpenSubmenu()">

The onload call to autoOpenSubmenu() should be inside of the <body> tag, like so:
Code:
<body background="" bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0" onload="autoOpenSubmenu()">


I think that's about it. Give that stuff a try and see how it goes. Remember that there's a downloadable zip file that contains the example I made. You can download it, unzip it to a new foder and run it locally, or open the files in an editor and see where the various codes are applied.

Hope that helps,

Kevin

Submenus


Poster: Tessa
Dated: Tuesday June 15 2004 - 18:53:27 BST

Kevin,

Thanks for that. I will try that, but first, I have just found out that my client has a Mac and apparently Macs seem to view sites very differently to PCs. One of things he said was bugging him was that the menu didn't go the full width. As the next bar down (the heading bar) is in a table, this is automatically set on 100% width and so shows fine, hence the menu bar looking stupid for him. Do you know how I can fix this? And then do you know anything about the compatible viewability of sites for both PCs and Macs or do you someone who does? It something I've never come across before.

Thanks for all your help by the way.

Tessa


Poster: kevin3442
Dated: Tuesday June 15 2004 - 23:19:16 BST

Hi Tessa,

Unfortunately (or fortunately, depending on one's perspective), I am in a "No Mac Zone." There isn't a Mac anywhere in sight, so I don't do Macs. There are, however, other people in the forums who do have access to Macs, and even prefer them for some reason ;) Perhaps one of them can help with Mac issues.

Cheers,

Kevin


Poster: Ruth
Dated: Wednesday June 16 2004 - 2:20:18 BST

Here's a tool to see how the pages look in safari. You put the url in the place at top where it says URL then click then wait however long it says, I think 30 secs or so. It will provide you with a screenshot of the page, so you can see how the menu looks as you experiment with what needs to be done. iCapture


Ruth

Menus width


Poster: Tessa
Dated: Thursday June 17 2004 - 2:51:21 BST

Hi guys (yet again!),

Can the four colours in the main menu be made equal sizes? ie, I think we had them set at 25% each which was what Ruth recommended but now that I have been using Kevin's codes, now I'm not so sure!! So could either of you help me here?

I am also wanting to reduce the height of the submenus too by half - is this possible?

Thanks

Tessa


Poster: Maz
Dated: Thursday June 17 2004 - 2:56:48 BST

Are you using itemwidth and itemheight?
That's where you would normally adjust the sizes.
Menuwidth and menuheight is the whole menu size.

I haven't been following the whole thread.

maz

Menu again


Poster: Tessa
Dated: Thursday June 17 2004 - 3:01:18 BST

Thanks Maz, no, I will need Kevin mainly to answer as it is more in depth, but thanks anyway.

Kevin, I have just found out something else that is a more urgent issue. After looking through the site's pages etc, sometimes I find two or three of the submenus are staying visible over on the lefthand side. Is there any way of ironing out these little problems? My client is such a perfectionist that he is absolutely driving me crazy!!! Mind you, I must admit, this didn't look the best.

Thanks

Tessa

Re: Menu again


Poster: John
Dated: Thursday June 17 2004 - 5:17:38 BST

I've been staying in the background on this one, mainly because the other Team members picked it up first and have been bustin' their backs trying to help you out.

However, getting down towards the end of the current conversation I'm starting to not like what I see. In my view (personal, not Milonic), you don't seem to really be paying attention to the advice you are being given. You're not fully following Kevin's concise directions, and tossing away those given by others; e.g.,...
Tessa wrote:
Thanks Maz, no, I will need Kevin mainly to answer as it is more in depth, but thanks anyway.

While the Team does have individual areas of expertise, the entire Team still does know the menu. Further, since I guess I'm the senior member here, I'll just say I won't have my Team members treated like that. We're all volunteers, we do not work for Milonic, and those folks are trying their best to help you. They are not your slaves.

Chill, back off a bit, READ carefully what they are telling you, and follow the excellent directions. This should not have taken 2 pages.


Poster: Ruth
Dated: Thursday June 17 2004 - 6:40:52 BST

The menus that are staying open on the left are the result of not fixing the onload codes on certain pages as Kevin discussed in his post.

Ruth

Submenus


Poster: Tessa
Dated: Thursday June 17 2004 - 20:37:31 BST

Hi Maz,

I have to say that I was truly shocked by your post to me saying that I was treating the team like 'slaves'.

Firstly, I am very new to javascript and have not a lot of knowledge of using it. If you read my previous posts to the team members, you will see how polite I am and give thanks etc. I was amazed at how they have been so willing to help and thought this must just be part of how the forum works. I didn't 'toss' your comment aside as I thought I was very polite to you. I am sorry if you read that incorrectly.

Secondly, when I purchased this menu, I was told it was fully customisable and that I would find full support here on Milonic's site. This is what I thought I was doing and was entitled to.

So, have I been wrong in using the forum? I thought both Kevin and Ruth had been excellent helping me. I know Ruth said she volunteered to do it as she enjoyed it.

If I have tred on anyone's toes or asked too much, please let me know and please accept my apologies. This menu has been one that I have found very difficult and also so happens to be for a very difficult client.

In the meantime, I will go through (again) the notes Kevin supplied and see if I can sort it out finally. But if I do end up needing to ask something, I really hope that's okay.

Tessa


Poster: John
Dated: Thursday June 17 2004 - 20:50:27 BST

Tessa, that was my post, not Maz', so you can blame me if you like.

Yes, you are entitled to our support, and this is the right place to ask for it. My problem was two-fold - you were not following the excellent instructions given by the Team, and the comment you made to Maz (mentioned by me in the earlier message) was taken by more than one Team member to be a slap in the face to her after all she was doing to try and help you. If we read your comment in the wrong 'tone', then we apologize.

You are still welcome (and entitled) to ask questions here any time. However, all we ask in return is that you carefully follow the instructions and suggestions given to you (Team members have mentioned a few instances where you did not do what was suggested, even when suggested more than once).

It's new to you, I know, but it's not difficult, especially with the support you have been given. Take a deep breath (we all will!), and these folks will get you going (if you do what they say).

OK :?: :D

Item width/height


Poster: Tessa
Dated: Monday June 21 2004 - 4:33:38 BST

Hi again,

This morning I worked on the menu again and tried to work out (for myself) how to fix the few minor things that need fixing ie, main menu item widths, submenu heights and correct displaying of submenus etc. I really am stumped.

I went through each page of the site and double checked the onload codes I have there and there was one page that wasn't right, so fixed that. (One of you may want to have a little lookie for me just to confirm this?)

I have also tried to work out what the correct wording is to call the height of each item within the submenu because I want to decrease the height of them by half. Is it separator padding??

And with the main menu bar with the four headings, I cannot for the life of me work out how to make these coloured bands show equally. Early on in the questions, Ruth was helping me with the item width to be 25% each but in the end we changed it to 100% for the main menu. Now that we've had a few variations of this menu, I really am not sure where to even put the code that I need to put in! Does that make sense?

Anyway, if someone can help with me with this final adjustment, I would be eternally grateful and then I can leave you all alone!!


Poster: Ruth
Dated: Monday June 21 2004 - 4:48:19 BST

Tessa, what's the url? Do you mean the main site or the index.htm link you gave earlier, just to be sure we are checking the correct pages. Thanks.

Ruth


Poster: Ruth
Dated: Monday June 21 2004 - 6:03:58 BST

Since, I was sitting here bored out of my mind, I went to the main site and checked that. All the pages seem to work perfectly. I checked every one, going to them and then mousing over the menu on each.

As to the other issues:

1. itemwidth, if you upgrade to 5.25, making sure you keep your 3 old milonic_src, mmenudom and mmenuns files until you are positive there's no conflict between the new version and something on the site, then you can set this code in the menu

Code:
alwaysvisible=1;
itemwidth="25%";
menuwidth="100%";

and the items will be perfectly spaced. That issue was fixed in the newer version. Just go to the main site, login and then download the new version. Also, you can go hereand find "watch this topic" and mark it, then whenever there is an update you will get an automatic email notification.

2. itemheight, one of the problems is that you have padding set to 5, so that means on the vertical menus each item has 5px above and below it. But, you can set itemheight in the menu in the same area you have the alwaysvisible, put itemheight=15; or whatever you want, but the padding will affect the height of the items.

The site looks really good! If you have any more problems just give a yell.

Ruth

Menu


Poster: Tessa
Dated: Monday June 21 2004 - 20:32:32 BST

Thanks Ruth.

It's always a bit scary to download the later version, I will try this later. I suppose I can't try those codes you gave me without downloading the later version?

Thanks for saying the site looks good.

Will let you know,

Tessa


Poster: Ruth
Dated: Tuesday June 22 2004 - 0:51:59 BST

Tessa,
Put the files you now have in a separate folder, then download the new version, upload the 3 files milonic_src.js mmenudom.js mmenuns4.js to the site, check out how the site works. It's something you can do pretty quick. If there's a problem, then just upload the 3 older files you put into another folder to keep secure. I ALWAYS keep the older files in a separate folder from where I download the newest version.

Ruth