Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-05-2005, 12:48 PM   PM User | #1
jstewie
New Coder

 
Join Date: Jun 2005
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
jstewie is an unknown quantity at this point
Background color/ Text Color - JavaScript, need help ASAP

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>
jstewie is offline   Reply With Quote
Old 07-05-2005, 03:29 PM   PM User | #2
martin_narg
Regular Coder

 
martin_narg's Avatar
 
Join Date: Jul 2002
Location: Chamonix, France
Posts: 600
Thanks: 1
Thanked 3 Times in 3 Posts
martin_narg is an unknown quantity at this point
Funny thing...

this came back false:
Code:
return /please|could you|any chance|i would be grateful|thanks/gi.test(http://www.codingforums.com/showthread.php?t=62786);
__________________
"Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
-Tommy Cooper

Last edited by martin_narg; 07-05-2005 at 03:32 PM..
martin_narg is offline   Reply With Quote
Old 07-05-2005, 04:15 PM   PM User | #3
jstewie
New Coder

 
Join Date: Jun 2005
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
jstewie is an unknown quantity at this point
False? What do you mean?

False? What do you mean?
jstewie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:48 PM.


Advertisement
Log in to turn off these ads.