JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 1st, 1999, 09:41 AM
minaz
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #2  
Old June 9th, 1999, 03:49 AM
SHAWSHANK
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.


Reply With Quote
  #3  
Old June 10th, 1999, 01:40 PM
click_46
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
both wrong...

document.layers[layername].bgColor = myColor

Later,

click_46

Reply With Quote
  #4  
Old July 16th, 1999, 12:20 AM
Peter.G
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > changing layer properties in Javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT