View Single Post
  #10 (permalink)  
Old Nov 22nd, 2007, 21:07
MikeHopley MikeHopley is offline
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS changing page colour etc

Note that you cannot simply use:

Code: Select all
body.className = "dark"
...because this will not work with multiple class names ("dark" will replace all existing class names). You need a way to add and remove class names. Fortunately, you can use this javascript.

This is really useful in other situations too.

I should note that, one day, style switching might become common user behaviour, with prominent, intuitive browser controls. If this ever happens, my method will become bad. But until then, I like my method better.
Reply With Quote