Forums Archive Index > SmartMenus 5 > Specifying Item BG Image in Stylesheet Array

Author: sudnshok

Date: 12 May 2005 11:50 am

I know you can specify a (mouseover state) bg image for a menu item using OnBgImage for each item, but is there a way to specify this in the stylesheet array? Or do I need to add this attribute to every single item?


Author: smartmenus

Date: 12 May 2005 3:40 pm

It is currently not possible but as I think it's definitely a good idea to make it possible. I will have this in mind for the next release of the script..

For now, you will unfortunately have to specify the bg image for all menu items. I can give you a hint though- it's a good idea to define a new variable for the image source to save some bytes. For instance:

Code:
s="your_bg_image_source";

s_add(
{N:'sample',LV:1,MinW:130,T:10,L:10,P:true,S:s_CSSTop},
[
{U:'http://www.smartmenus.org/',T:'SmartMenus DHTML menu',OnBgImage:s},
{U:'http://www.smartmenus.org/',T:'SmartMenus DHTML menu',OnBgImage:s},
{U:'http://www.smartmenus.org/',T:'SmartMenus DHTML menu',OnBgImage:s},
{U:'http://www.smartmenus.org/',T:'SmartMenus DHTML menu',OnBgImage:s}
]
);


Author: sudnshok

Date: 12 May 2005 3:54 pm

That's actually what I did. Thanks. Great job with this script by the way - one of the best, if not the best, I've seen for DHTML menus.