Give this demo a shot. Let me know if you have questions:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Flashing Tables</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icon" href="file://localhost/C:/webwork2/favicon.ico">
<style type="text/css">
/*Set initial style for table border(s) here (the off state)*/
#flashtable0, #flashtable1 {
border:5px solid green;
}
#ftable2s0, #ftable2s1 {
border:3px solid black;
}
</style>
<script type="text/javascript">
/***********************************************
* Flashing Table Script - © very freely adapted from
* Flashing Link Script- © Dynamic Drive (www.dynamicdrive.com)
* By jscheuer1 in http://www.dynamicdrive.com/forums
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function flashtables(id_base, flash_color, random, staggered){
if(!document.getElementById&&!document.all){return;};
var cacheobj=this;
var changebordercolor=function(el){
var el=el; el.style.borderColor=el.on=!el.on? flash_color : '';
setTimeout(function(){changebordercolor(el);},1000+(!random?0:Math.floor(Math.random()*234)))
}
var startchangeborder=function(el){
var el=el; setTimeout(function(){changebordercolor(el);},383+(!staggered?0:(cacheobj.it+=234)))
}
var init=function(){
var i=0; this.it=0; while(document.all&&document.all[id_base+i]!=null)
startchangeborder(document.all[id_base+i++]);
while (!document.all&&document.getElementById(id_base+i)!=null)
startchangeborder(document.getElementById(id_base+i++));
}; init(); };
</script>
</head>
<body>
<div>
<table id="flashtable0">
<tr>
<td>Table 0</td>
</tr>
</table><br>
<table id="flashtable1">
<tr>
<td>Table 2</td>
</tr>
</table><br>
<table id="ftable2s0">
<tr>
<td>Table 2.0</td>
</tr>
</table><br>
<table id="ftable2s1">
<tr>
<td>Table 2.1</td>
</tr>
</table><br>
</div>
<script type="text/javascript">
//usage new flashtables('id_base', 'flash_color(the on state)', random(1=yes - 0=no), staggered(1=yes - 0=no))
new flashtables('flashtable', 'red', 1, 1)
new flashtables('ftable2s', 'yellow', 0, 0)
</script>
</body>
</html>
Bookmarks