Forum Moderators: mack
I'm currently changing things around on my website - and have previously been using black background and white text (it look quite good really) but I really want to give users the option to switch between a white version and a black version of the site - I have two seperate HTML pages, but isn't there another way of going about this type of thing without using two different web addresses for the two different versions?
Any guidance is welcome!
Ta
Also, check out the CSS forum [webmasterworld.com] here for all kinds of information.
I am not sure if this is what you want, but this script will allow the users to change the background color of your site:
------------------------------------------------------
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Copyright 2001 by CodeBelly
// Please do *not* remove this notice.
var backColor = new Array(); // don't change this
// Enter the colors you wish to use. Follow the
// pattern to use more colors. The number in the
// brackets [] is the number you will use in the
// function call to pick each color.
backColor[0] = '#FF0000';
backColor[1] = '#00FF00';
backColor[2] = '#FFC0C0';
backColor[3] = '#FFFFFF';
// Do not edit below this line.
function changeBG(whichColor){
document.bgColor = backColor[whichColor];
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<!--
changing bg color with a mouse click.
Set the number in the () in the changeBG() function
to the number of the color in the brackets in the
backColor[] array to select a given color.
//-->
<a href="javascript:changeBG(1)">Change by clicking on link</a>
<!-- Script Size: 1.79 KB -->
------------------------------------------------------
I would also not recommend you use a black background with white text. If a user tries to print your page, nothing will show up on the printout.
I hope this helps, and best of luck!