PDA

View Full Version : Can viewer change background color?


keano
03-16-2006, 04:56 PM
Is there a way to give the viewer an choice of color and they click on a box and change the color of the background for the whole site?

Creative Insanity
03-16-2006, 05:51 PM
Yeah use differant css files and a have links to select and insert the style you want.

domedia
03-19-2006, 04:54 PM
Actually, you can do it very simple by using web standards and the Document Object Model (DOM):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Change background color test</title>
<script type="text/javascript">
function changebg()
{
document.body.style.backgroundColor = "red";
}
</script>
</head>
<body>
Change Background (#)
</body>
</html>

Creative Insanity
03-19-2006, 05:06 PM
I thought he mean the complete site dom.. buttons and everything, not just the background.

domedia
03-19-2006, 05:41 PM
oh yeah, the power of CSS based designs ;)
The best showcase of what you can do with stylesheets when you seperate structure from design:
http://www.csszengarden.com/
All the sites use the exact same HTML, and only change stylesheet, believe it if you can..