ManyCodes.com – codes & scripts Get free programming codes and tutorials!

28Jul/090

How to allow your visitors to change the background colour of your website

Here is how you can change the background colour of your website. This will allow the user to change the background color of your page.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
<!-- Start of Change BackGround Color-->
<!--   DESCRIPTION:  This will allow the user to change the background color of your page.  Neat trick.

 INSTRUCTIONS:  Place this script anywhere in the <BODY> tag.

 FUNCTIONALITY: Works in both Netscape and IE.
-->
<!--
//Modified by CoffeeCup Software
//This code is Copyright (c) 1998 CoffeeCup Software
//All rights reserved. License is granted to a single user to
//reuse this code on a personal or business Web Site.
// -->
<CENTER>
<FORM>
<FONT FACE="VERDANA, ARIAL"><B>Choose a background color:</B></FONT>
<SELECT name="ccGround" size="1" onChange=(document.bgColor=ccGround.options[ccGround.selectedIndex].value)>
<OPTION value="408080" target="1" selected>Cool Green
<OPTION value="C0C0C0" target="1">Cool Grey
<OPTION value="000000" target="1">Black
<OPTION value="730200" target="1">DarkRed
<OPTION value="231800" target="1">Brown
<OPTION value="044302" target="1">DarkGreen
<OPTION value="0D09A3" target="1">Dark Blue
<OPTION value="808040" target="1">Avocado
<OPTION value="800080" target="1">Purple
<OPTION value="444444" target="1">Gray
<OPTION value="FF0400" target="1">Red
<OPTION value="EFE800" target="1">Yellow
<OPTION value="05EF00" target="1">Green
<OPTION value="0206FF" target="1">Blue
<OPTION value="AE08EF" target="1">Violet
<OPTION value="FF8C8A" target="1">Mauve
<OPTION value="FF80FF" target="1">Pink
<OPTION value="FFCCCC" target="1">Peach
<OPTION value="FFCC99" target="1">Orange
<OPTION value="000080" target="1">Darker Blue
<OPTION value="808080" target="1">Dark Grey
<OPTION value="D5CCBB" target="1">Tan
<OPTION value="DDDDDD" target="1">LightGray
<OPTION value="FBFF73" target="1">Light Yellow
<OPTION value="7CFF7D" target="1">LightGreen
<OPTION value="A6BEFF" target="1">Light Blue
<OPTION value="FFFFFF" target="1">White
</SELECT></FORM></CENTER>
<!-- Start of Change BackGround Color-->
<pre><font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font></pre>



Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Webnews
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Ask
  • Facebook
  • Technorati
  • YahooBuzz