Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 05-31-2009, 06:51 PM Alter the CSS?
Novice Talker

Posts: 7
Trades: 0
Lets say I have this CSS code:

<style type="text/css">
.list li
{
background-color: #E5AD41;
}
</style>


How would I let JavaScript change it to background-color: #83E553?

I am not wanting to change bgcolor where class is list, that is all Google brings me.
egillsigurdur is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-31-2009, 10:35 PM Re: Alter the CSS?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I'd recommend creating classes that you want to switch between and updating the className when you want to change the background color.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-01-2009, 07:06 AM Re: Alter the CSS?
Novice Talker

Posts: 7
Trades: 0
No, that really doesn't work. I'd like to be able to change everything in the CSS, not just couple of things. Ok, I guess this is maybe not possible.
egillsigurdur is offline
Reply With Quote
View Public Profile
 
Old 06-01-2009, 09:18 AM Re: Alter the CSS?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
It's possible, but there are compatibility issues.
http://msdn.microsoft.com/en-us/libr...71(VS.85).aspx
https://developer.mozilla.org/Es/DOM/Stylesheet_object
and you'll have to do some research, because last I heard it won't work in Safari, though I hope this has changed by now.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 06-04-2009, 03:29 AM Re: Alter the CSS?
harish's Avatar
Average Talker

Posts: 26
Name: Harish kumar
Trades: 0
you can change the background of the list using that code also..

Code:
ul { background-image: url(pics/cssT/smallPic.jpg);
     background-repeat: repeat-y;
     color: green;
 }
__________________

Please login or register to view this content. Registration is FREE
||
Please login or register to view this content. Registration is FREE
||
Please login or register to view this content. Registration is FREE
harish is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Alter the CSS?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15373 seconds with 12 queries