Jump to content


Photo

javascript and css classes


  • Please log in to reply
1 reply to this topic

#1 Goose

Goose
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts
  • LocationOregon

Posted 06 March 2006 - 06:49 PM

Basically I want a javascript to change a property in a css class. I know the class name and I have the property and the value I need to change the property to. Is there a way that javascript can edit the class and then all the objects that hold that class refresh so that they reflect the new values?

Thanks.

Edit: If anyone can just post an example snippet of code, that would be awesome. The class name that I want to edit is named "trow" and the property I want to edit is "display" and I want to set it to "none".

#2 fooDigi

fooDigi
  • Members
  • PipPipPip
  • Advanced Member
  • 250 posts
  • LocationDuluth, Mn

Posted 10 March 2006 - 10:17 AM

i think all you have to do is have two different classes... one with display:none, one with display:block, and have everything you need to change have the same id. then use document.getElementById(yourid).className = 'off' ... or whatever. try it. seems correct.
All your base are belong to us.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users