Hi Maz,
Regarding the line or layer of color at the bottom of the menu:
I didn't know exactly what look you're going for, so I modeled my effort after the example you referred to at the bottom of your page. In general, I think you can get the effect you're looking for by:
(1) Create two images: one will serve as both the
bgimage and the
menubgimage; let's call it "bgimag.gif". The other will serve as
overbgimage, for a rollover effect; let's call it "overbgimage.gif". Put them in your /template/main/images/ directory, where your other images are. These images should both have the following properties:
- Each image should be only one pixel wide.
- The bottom X pixels should be the color of the line you want, for both mouse off (bgimage.gif) or mouse on (overbgimage.gif). X is the height, in pixels, that you want the line to be (i.e., how thick of a line do you want?). The remainder of the image should be whatever color you want the 'background' of the image to be, in both mouse off and mouse on states (I used white for both since that's how the menu at the bottom of your page is, but you could use different colors to get a background rollover effect).
- To ensure that your menu item text centers vertically on the background images, each image should have a height of 2(X)+Y, where Y is the height, in pixels, of your menu item text. So, for example, I see that the text in your "xtopmenu" is 7px tall. If you want a 4px-high line under the text (as is the case at the bottom of your page), then bgimage.gif and overbgimage.gif would be 2(4)+7 = 15px high.
By following these guidelines for making the images, you will ensure that the menu item text sits right on top of the line, as it does at the bottom of your page. You could play with the height of the images, and the height of the line color at the bottom of each to get different effects.
Sample images: As I was testing this approach, I created a bgimage.gif and an overbgimage.gif. I was trying for a look similar to what you have at the bottom of your page. Here they are (look closely, because they are very small)...
bgimage.gif -> 
overbgimage.gif -> 
(2) For the background images to show through, you need to set
onbgcolor and
offbgcolor in your
xptopmain menu style to "transparent" (BTW: you can also ensure that they are transparent by simply not defining them... i.e., leave those properties out of the style definition altogether).
(3) Also in the xtopmain menu style, set the following background image properties:
Code: Select all
bgimage="/template/main/images/bgimage.gif";
menubgimage="/template/main/images/bgimage.gif";
overbgimage="/template/main/images/overbgimage.gif";
(4) Also in the xtopmain menu style, you have to specify the
itemheight; it should be the same height as your bgimage.gif (15 in the example above). I notice in your code you set
itemheight in quotes and specify a unit of measure, like this:
itemheight="10px";. Since heights and widths in the menu settings are in pixels and are numeric values, you'd be better off doing it like this:
...no double quotes and no 'px'.
With all that in mind, your edited
xtopmain menu style would look like this:
Code: Select all
with(xptopmain=new mm_style()){
offcolor="#0033ff";
oncolor="#778899";
bgimage="/template/main/images/bgimage.gif";
overbgimage="/template/main/images/overbgimage.gif";
menubgimage="/template/main/images/bgimage.gif";
padding=0;
fontsize="10px";
fontfamily="trebuchet, arial, sans-serif";
pagecolor="#ff0033";
subimageposition="left";
subimage="/template/main/images/xarrowdn.gif";
onsubimage="/template/main/images/xarrowdnon.gif";
itemheight=16;
}
As you've noted, the images when used as backgrounds will repeat, and there's no built-in method yet to control the background-repeat style (you can, however, do it programatically... but that's another discussion). But by making the images and the menu items the same height, you essentially cancel out the repeat-x dimension and use repeat-y to your advantage to fill the background, no matter how wide an item is!
Sample images: Since the sample images above are so small, I zipped 'em for you. You can
download the zip here, then unzip it to your /template/main/images/ directory.
Test: I tested the approach with your menu on a blank page. To try it,
download maz_test.zip, unzip it to its own folder, copy your milonic_src.js, mmenudom.js, and mmenuns4.js into that folder, then open menu.htm. Note that I canged your images paths from "/template/..." to "template/..." in my test, so that I could run it locally. This test worked in IE6, NS7.1, Opera 6.05, and Opera 7.0 in Win2kPro. Sorry... but I don't have any Macs.
A couple of last notes... just FYI, menualign appears to be broken in RC40+ for lots of browsers, not just on Macs. I'm sure it'll be fixed soon. Also, in pondering this stuff, I realize that what you wanted to do in "drawing" a line with javascript would be possible... not by drawing a line directly (can't do that with js as far as I know), but by finding the menu object and manipulating it's style properties programatically with js. But that might be for a later discussion.
Let me know how it goes.
Hope that helps,
Kevin