Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Alternating colours in a table cell

Reply
Thread Tools

Alternating colours in a table cell

 
 
Trev
Guest
Posts: n/a
 
      11-07-2006
Is there any way to make table cell's bgColor alternate, simulating a
flashing effect?

 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      11-07-2006
Trev wrote:
> Is there any way to make table cell's bgColor alternate, simulating a
> flashing effect?


Yes.

Richard.

 
Reply With Quote
 
 
 
 
Trev
Guest
Posts: n/a
 
      11-07-2006

Richard Cornford wrote:
> Trev wrote:
> > Is there any way to make table cell's bgColor alternate, simulating a
> > flashing effect?

>
> Yes.
>
> Richard.


please elaborate!!!!

 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      11-07-2006
Trev wrote:
> Richard Cornford wrote:
>> Trev wrote:
>>> Is there any way to make table cell's bgColor alternate, simulating a
>>> flashing effect?

>>
>> Yes.
> >
> > Richard.

>
> please elaborate!!!!


An ability to use scripts to apply specific background colors to
individual table cells implies an ability to alternate the colours
used, both sequentially and with time.

Richard.

 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      11-07-2006
Trev a écrit :
> Is there any way to make table cell's bgColor alternate, simulating a
> flashing effect?
>


Arrrghhh ! beurk !

<td id="flashy" style="background:lime">


javascript in head :

onload = function() {
setInterval( function() {
var flsh = document.getElementById('flashy').style;
flsh.background = flsh.background=''? 'yellow' : '';
}, 100);
}
 
Reply With Quote
 
Trev
Guest
Posts: n/a
 
      11-07-2006

Richard Cornford wrote:
> Trev wrote:
> > Richard Cornford wrote:
> >> Trev wrote:
> >>> Is there any way to make table cell's bgColor alternate, simulating a
> >>> flashing effect?
> >>
> >> Yes.
> > >
> > > Richard.

> >
> > please elaborate!!!!

>
> An ability to use scripts to apply specific background colors to
> individual table cells implies an ability to alternate the colours
> used, both sequentially and with time.
>
> Richard.



Is there any way to implement this in Javascript, and if so, how?
I have tried using a while(true) loop using the <td>'s element name and
changing bgColor but the code has a malaise.

 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      11-07-2006
Richard Cornford a écrit :
> Trev wrote:
>> Richard Cornford wrote:
>>> Trev wrote:
>>>> Is there any way to make table cell's bgColor alternate, simulating a
>>>> flashing effect?
>>> Yes.
>>>
>>> Richard.

>> please elaborate!!!!

>
> An ability to use scripts to apply specific background colors to
> individual table cells implies an ability to alternate the colours
> used, both sequentially and with time.
>
> Richard.




well seen !
 
Reply With Quote
 
Trev
Guest
Posts: n/a
 
      11-07-2006
Tried it...still some malaise....

<HTML>
<HEAD onload = function() {
setInterval( function() {
var flsh = document.getElementById('flashy').style;
flsh.background = flsh.background=''? 'yellow' : '';
}, 100);
} >

</HEAD>
<BODY>



<table>
<tr><td id="flashy" style="background:lime">whizz</td><td>eggy
xt</td><td>bang</td></tr>
</table>

</BODY>


</HTML>

 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      11-07-2006
Trev a écrit :
> Tried it...still some malaise....


I said in *javascript* ! ...

(in header)

You don't know how to input a script code in a html file ?
 
Reply With Quote
 
Trev
Guest
Posts: n/a
 
      11-07-2006

ASM wrote:
> Trev a écrit :
> > Tried it...still some malaise....

>
> I said in *javascript* ! ...
>
> (in header)
>
> You don't know how to input a script code in a html file ?



Damn, sorry, my mind slipped on a dog turd.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
printer colours vs 'real' colours dido22 Digital Photography 4 06-15-2007 03:37 PM
javascript to change cell background colours on a timer. Peter Williams Javascript 3 06-01-2005 06:30 PM
How Do I Print Table Cell Colours? Amirallia ASP .Net 1 01-27-2005 10:59 AM
How Do I Print Table Cell Colours? Amirallia ASP .Net Web Controls 0 01-27-2005 08:54 AM
How Do I Print Table Cell Colours? Massimo Capetola ASP .Net Web Controls 3 09-29-2004 09:16 AM



Advertisments