pacman, rainbows, and roller s

MATRIX

Dynamic Background Color

Description:
Use this code to dynamically change the color of your background. Much easier than some of the more confusing versions out there. Control the color of your background using the links on your site. Control the color using onMouseOver, onMouseOut, onClick, and a combination of all of them.
Directions:
Use the 'Grab Text' buttons to select the code within the adjacent textarea. Then use Control-C or Edit -> Copy to buffer the text for pasting into your document.
EXAMPLES:
Note: The example changes the table background color instead of the page background color. This is only for example purposes, the code below will work as described.
1) When mouse passes over the link.
2) When mouse moves off the link. (move mouse over then move mouse off)
3) When you click on the link.
4) When mouse passes over the link and when you take mouse off link.
5) When mouse passes over the link, when you take mouse off link, and when you click the link.
Place the code below between the <BODY> and </BODY> tags within the HTML page where you want the link to appear. Edit the link text provided to point at the page you would like to open.
Option 1: Use this to change the background color when user places mouse over the lin
<a href="link.htm" onMouseOver="document.bgColor='red'">Link Text</a>
Option 2: Use this to change the background color when user removes mouse from over the link (onMouseOut).
<a href="link.htm" onMouseOut="document.bgColor='green'">Link Text</a>
Option 3: Use this to change the background color when user clicks the link (onClick).
<a href="link.htm" onClick="document.bgColor='blue'">Link Text</a>
Option 4: Use this to change the background color twice, once when the user places the mouse over the link then again when the user takes the mouse off the link (onMouseOver and onMouseOut).
<a href="link.htm" onMouseOver="document.bgColor='red'" onMouseOut="document.bgColor='green'">Link Text</a>

Acasa ©MATRIX