...

View Full Version : Background color/ Text Color - JavaScript, need help ASAP



jstewie
07-05-2005, 01:48 PM
Background color/ Text Color - JavaScript, need help ASAP

--------------------------------------------------------------------------------

need help with this script... Big time, I like that it allows webpage viewers to change both the text color and the background color. But I need to allow the viewer to set the colors, like create a cookie or something. At the same time, be able to change the color of the background without changing the color of the text. This script does both at the same time, it's hard on the eyes. I need to allow viewers to change the background text and set it and then change the text color and set that too.

<SCRIPT language=JavaScript>

lck=0;

function r(hval)
{
if ( lck == 0 )
{
document.bgColor=hval;
document.fgColor=hval;
document.f.c.value=hval;
}
}

function l()
{
if (lck == 0)
{
lck = 1;

}
else
{
lck = 0;

}
}


</SCRIPT>


<BODY bgColor=#ffffcc>
<P>
<CENTER>
<P>
<TABLE border=0>
<TBODY>
<TR>
<TD bgColor=#000000><A onmouseover="r('#000000'); return true"
href="javascript:l()"><IMG height=10 src="" width=10 border=0></A></TD>
<TD bgColor=#000033><A onmouseover="r('#000033'); return true"
href="javascript:l()"><IMG height=10 src="" width=10 border=0></A></TD>
<TD bgColor=#000066><A onmouseover="r('#000066'); return true"
href="javascript:l()"><IMG height=10 src="" width=10 border=0></A></TD>
<TD bgColor=#ffffff><A onmouseover="r('#ffffff'); return true"
href="javascript:l()"><IMG height=10 src="" width=10
border=0></A></TD></TR></TBODY></TABLE>
<P>
<FORM name=f><INPUT size=7 name=c> </FORM>
<p><font size="7"></font></p>

martin_narg
07-05-2005, 04:29 PM
Funny thing...

this came back false:



return /please|could you|any chance|i would be grateful|thanks/gi.test(http://www.codingforums.com/showthread.php?t=62786);



:rolleyes:

jstewie
07-05-2005, 05:15 PM
False? What do you mean?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum