MenuBackgroundProperties can be used to pass additional
CSS properties pertaining to the MenuBackgroundImage, such as left
or repeat-x, to the CSS background property of the menu. Such
parameters complement the MenuBackgroundImage itself and typically provide
further instructions to the browser pertaining to the exact placement and behavior
of the background image.
The values allowed for MenuBackgroundProperties mirror those allowed
within standard CSS definitions. The full scope of properties that are allowed
(and their meanings) is beyond the scope of this document, but a complete description
can be found at the W3C site here.
Support for specific MenuBackgroundProperties is highly browser dependent.
Be sure to test your menus in a variety of browsers and platforms when using
background image properties.
In order for MenuBackgroundProperties to be utilized,
MenuBackgroundImage must be set. If MenuBackgroundImage is
not set, then MenuBackgroundProperties will be ignored.
The scroll/fixed property of menu background images will be ignored by
HierMenus (even though it is set by default). To set the scrolling status
of the menu background image, use ScrollBackgroundImage instead.
When using background images, you will generally want to set your
background colors (MenuBGColor and BGColor) to transparent,
to ensure that the item and menu background colors do not overlay the menu's
background image. Another tip is to set ScrollBackgroundImage to true,
set BGColor to transparent,
and then specify a valid MenuBGColor. When set this way, the background image
will overlay the MenuBGColor. Those with image support in their browsers
will see the image as you intended, while those without will see the MenuBGColor
as the default menu item background.
As noted above, some browsers will not support image backgrounds at all, and
therefore their menu text displays may not be appropriate. Creating a menu where
the readability of the text is dependent on a menu background image is not recommended.
You can, however, use the built in HM variable HM_BackgroundSupport in your
configuration file to supply alternate color schemes for those menus that depend
on background images:
BGColor:(HM_BackgroundSuppport)?"transparent":"black",
Note that HM_BackgroundSupport only indicates whether HM will support
the application of background images to menus in the user's browser. It does
not indicate whether or not the user allows images to be displayed
within their browser.
// Ok:
MenuBackgroundProperties:"repeat-x",
MenuBackgroundProperties:"left repeat-y",
MenuBackgroundProperties:null,
MenuBackgroundProperties:(window.showBack)?"left":"right",
// if the user defined variable "showBack" is true,
// use "left" positioning, else "right"
// Incorrect:
MenuBackgroundProperties:repeat-x, // Strings must be quoted
MenuBackgroundProperties:"null", // null must NOT be quoted
MenuBackgroundProperties:"ZigZag", // only valid CSS values allowed
MenuBackgroundProperties:'(window.showBack)?"left":"right"',
// no quoted expressions