Random Background
Get a random background color with the touch of a button. This JavaScript uses 15
pre-determined background colors and then randomly chooses one. This is a great
effect if you know what background colors don't interfere with the text on your
page. Then, you can make them the 15 pre-determined background colors.
This script will work in most recent browsers including FireFox
Insert into <HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function rnd(scale) {
var dd=new Date();
return(([Link]([Link]([Link]([Link]()))*1000000000)%scale));
}
function show() {
[Link]=[Link];
[Link]=[Link];
}
[Link]=256*rnd(255)+16*rnd(255)+rnd(255);
[Link]=256*rnd(255)+16*rnd(255)+rnd(255);
// End -->
</SCRIPT>
Insert into <BODY>
<CENTER>
<a href="javascript:[Link](0)">Click here to get new colors</a>
</center>
<FORM name=blah>
<table border=0 width=100%><tr><td align=left>Foreground color</td>
<TD align=right>Background color</TD>
</TR>
<TR>
<TD align=left>
<input type=text name=fg>
</TD>
<TD align=right>
<input type=text name=bg>
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>