The setBGColor() method will change the color of the background of the layer.
objectName.setBGColor(color)
Where color is the hexidecimal or color name in quotes.
Example:
mylayer.setBGColor('#C0C0C0')
Warning:
In Netscape there is an issue that will cause problems when using this method. When you set the CSS background-color in Netscape, that property is applied to the background color of the text, not the background color of the entire layer. This is the reason you have to set both the background-color and the layer-background-color properties in order for Netscape to color the entire layer the color you want. All is fine until you try and change the background color using the setBGColor() method. This method will change the layer-background-color property leaving the text with your original background color.
There are ways around this problem:
View dynlayer-bgcolor1.html for an example illustrating this problem.
| Home | Next Lesson: Geometric Objects |