Forums Archive Index > SmartMenus v4.x General > Transparent Menus

Author: orlando furioso

Date: 22 May 2003 11:31 am

Hi all ya guys out there ...

does anybody know how the stylesheet in the ARRAYS File has to be changed to create a transparent menu. I just like to have the table transparent and then insert transparent .GIFs.

Is this possible?

cheers


Author: smartmenus

Date: 23 May 2003 7:10 pm

Hi,

First of all, thanx for reporting that the script works with Safari in your previous post. I would be happy if you are not too busy and could test the examples in the download file and share the results (for example does the window size detection and event positioning work correctly if you scroll or resize the window, are the cross-frame examples working...). I don't have a Mac with OS X and it will be a problem for me to test the SmartMenus with the Safari browser in very near future. However I've read some resources regarding the Safari specifics and am trying to optimize the code "blindly" for it. I hope to soon get a Mac with OS X and do thorough tests. But as far as I know about Safari it will be absolutely no problem to support it completely as this is really a modern browser and the SmartMenus are compatible with much older browsers.

Now to your question about the transparent menus. Opera 5/6 doesn't support setting of transparent background color correctly. More precisely said, it supports setting it, but if you set transparent background color for any element, you will not be able to change it dynamically through a script. You can still use transparent background in the other browsers except Netscape 4.x. Netscape 4.x supports this in a different way but I have not implemented this in the script, mostly because of the Opera5/6 bug. And by default I didn't want to go for features that would not be supported equally in all browsers (a little exception are the filters in IE).

However the way you can define the style for the menus is very flexible and you can easily use transparent background in the browsers that support it. Example:

s_CSS1=[
'', // BorderColor
s_nS4||s_oP&&!s_oP7?'#CBCBEF':'transparent', // BgColor
'#4A49A8', // OverBgColor
'#4A49A8', // FontColor
'#FFFFFF', // OverFontColor
...

Transparent border is fully supported in all browsers without exception. You can have it by leaving empty quotes. After setting the border transparent (you cannot have a transparent item and non-transparent border, because the border color will fill all the menu background), you can have your items transparent in the supported browsers by using 'transparent' for BgColor.

I have performed a check for Netscape 4.x and Opera<7 and if the user uses one of those, '#CBCBEF' will be used instead of 'transparent'. s_nS4, s_oP and s_oP7 are built-in SmartMenus variables and represent the browsers I mentioned above.

That's it. I hope you will get it!

Regards and thanks again for the Safari feedback!