Re: User-changeable colours
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: User-changeable colours

From: Tim Green <strawblond@sympatico.ca>
Date: Tue Jun 21 2005 - 01:18:20 CEST

Hi Danny,

I read a few of the references (before seeing your note), and experimented a
little. Took me all Sunday, but I got exactly what I was looking for. And
used the same technique you describe. I also learned I could pass arguments
to the function I created, so I didn't have to create all kinds of extra
code.

Thanks. Wish I had seen your note first... :)

- Tim
"Danny" <dann90038@bluebottle.com> wrote in message
news:1119228805.d74dafb4daa0fc38e13710fee8c12466@teranews...
>
> Give both the targetted objects/nodes, in this case the cells, an ID, the
> use on the one receiving the click
> onclick="document.getElementById(YOURIDHERE).style.background='YOURCOLORHERE'";,
> I use something akin to that for a color checker off a list, along the
> lines of <td style="background: #789"
> onclick="document.getElementById(YOURIDHERE).style.backgroundColor=this.style.backgroundColor">
> so, the user can just click on the colored cell to use it on the IDed box.
>
> Danny
>
> On Sat, 18 Jun 2005 19:16:04 -0700, Tim Green <strawblond@sympatico.ca>
> wrote:
>
>> Hi,
>>
>> I have a simple table with two cells.
>>
>> I'd like to present another two tables with 4 coloured cells (say, red,
>> blue, green and yellow), and invite the user to click on a colour in one
>> table to change the backround of the first cell, and on a colour in the
>> second table to change the background of the second cell.
>>
>> Does anyone know if there's a reasonably simple way to do this? Or can
>> someone show me a sample?
>>
>> Thanks for any hellp.
>>
>>
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Received on Tue Oct 18 02:46:47 2005