Question about Blinking a column in a table...

M

Mel

I need to blink a cell within my table using a preset color (say
"skyblue) for a fraction of a seconds (that I can specify through
function call).

I guess i should use Timeout of a sort.

can someone help me please ?

My function should look something like:
Blink (100ms, 'skyblue');

or something like that

Thanks in advance
 
A

ASM

Mel a écrit :
I need to blink a cell within my table using a preset color (say
"skyblue) for a fraction of a seconds (that I can specify through
function call).


function Blink(what, color, duration) {
// duration = time spent to blink (in ms)
what = (typeof what == 'string')?
document.getElementById(what) : what;
truc = setInterval( function() {
what.style.backgroundColor = (what.style.backgroundColor=='')?
color : '';
}, 50);
setTimeout('clearInterval(truc)', duration);
return false;
}

<a href="#" onclick="return Blink('aTd', 'skyblue', 700);">blink</a>
<table><tr><td id="aTd"> here blinker </td></tr></table>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,431
Latest member
ElyseG3173

Latest Threads

Top