|
|
||
When starting to customize the menu to integrate it in your site design, you must first take some time and think how will it look, and then create the menu, as you see it, in an image. This image will have to contain examples of the three (maximum, but you can have less) levels, with menu elements in all three states:
You can see these states reflected in the default images in the img folder, that also carry significant names:
You will have to show these three states for all menu levels you plan on using. For what concerns the customizations in this tutorial, the following image will be used as a source:

In this image you can clearly see the three levels and their associated states:
As you can already guess, there are three images for the first level already, which will have to replace the default ones in the img folder.
Aside these regular images, you might have already notices the edges of the top-level: they're rounded, and might pose a problem, as the default skin did not have any special images to display them.
This last problem must be analyzed before starting to cut the images, as it will need a little touch of CSS tehnique to use: shifting images.
First off, why do we need to use such a technique instead of just throwing the images on the page? Well, primarily because there aren't images that act like that in the original skin, and second, because MX CSS Dynamic Menus uses div, ul and li tags to construct the menu, and adding an empty element with a background image would cause problems.
Second, how to do it? Well, because the images are used as background images, and because we're using CSS, we can use the background-position CSS property. With it, you can set the background image's position, on the x and y axis. If the value for an axis is positive, it will be moved in the positive sense of the axis. For the horizontal axis, the one that interest us, you can move it to the right by using a positive value, and to the left, by using a negative value.
The conclusion is simple: it can be done, and in an easy manner too. Thus, the image to create should contain the left rounded edge, the center, where the menu text will appear, and the right rounded edge too. The trick we're going to use through the shifting technique is to hide the edges for the menu blocks that do not need them.
But first, you'll have to create the images. To do so, follow the next steps:


For the selected and over images, you just have to replace the center portion with the white, and gradient-blue ones. Then just save them as bgtop_h_sel.gif, and bgtop_h_over.gif. You should now have three images that look like the following:

For the second and third level menus it is much simpler to cut the images, as it only takes three steps:
The resulting images should look like the following:

If you try and apply the skin to one of your menus in this state, you will notice that the new images are used, but appear with both edges all the time. Also, the behavior when trying to use the menu is not the one intended. For a simple menu structure, the menu looks like the following:

Not at all what we're trying to get to. The next section of the tutorial shows how to tweak the css file so that the menu will look and feel as intended.
|
|
||