|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a couple layers that I would like to change the background color for in Javascript. How do I do this? I tried this... but it gave me an error. document["lyr"].layer-background-color = "red"; The dashes in the layer-background-color property causes error in Netscape. Can someone please help me, Thanks. |
|
#2
|
|||
|
|||
|
I have tried to change layer properties too, but to no avail. This is particularly problematic when using tables in layers. However, I think your issue may be that you may be mixing style syntax with JS syntax. try:
documents[yourlayername].bgcolor = red; instead. |
|
#3
|
|||
|
|||
|
both wrong...
document.layers[layername].bgColor = myColor Later, click_46 |
|
#4
|
|||
|
|||
|
As far as I know, when you use style syntax, and have anything with a '-' in it, you got to remove the '-' and capitalize the character after it to get it to work in JS.
So 'layer-background-color' would be 'layerBackgroundColor'. ------------------ Peter.G peter@gladh.com |
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > changing layer properties in Javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|