Forum Moderators: open

Message Too Old, No Replies

flashing cell bgcolor with timer

         

cadywong

9:55 pm on Mar 1, 2005 (gmt 0)



hi i got this code from this forums

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Flasher</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
div{width:202px;position:absolute;top:50%;left:50%;margin-left:-100px;margin-top:-50px;}
table{border:solid 1px #000000;}
td#foo{width:100px;height:100px;border:solid 1px #000000;text-align:center;}
td#fool{width:100px;height:100px;border:solid 1px #000000;text-align:center;}
/*//]]>*/
</style>
</head>
<body>
<div>
<table><tr>
<td id="foo">Red cell</td>
<td id="fool">Green cell</td>
</tr></table>
</div>
<script type="text/javascript">
var e=document.getElementById("foo");
var colors=['#ffffff','#ff0000'];
var nextColor=0;
var f=document.getElementById("fool");
var colors1=['#00ff00','#ffffff'];
var nextColor1=0;
setInterval("e.style.backgroundColor=colors[nextColor++%colors.length];"+
"f.style.backgroundColor=colors1[nextColor1++%colors1.length];",300);
</script>
</body>
</html>

the problem with this code and my application is that
the cell on blink for 1 coloumn of cell only..
for the other coloumn doesn't flash at all..
the others thing is that how do i put timer on it..
for both cell i want to flash the same color..thank you for the help

orion_rus

8:15 am on Mar 4, 2005 (gmt 0)

10+ Year Member



if you want to flash with the same color you need to
var colors=['#ffffff','#ff0000'];
var colors1=['#00ff00','#ffffff'];
make it equal.
Sorry
I don't understand other question. Do you solve your problem?