View Full Version : Flashing Table Border Script - flash 6 borders on one page.

05-02-2007, 11:40 AM
1) Script Title: Flashing Table Border Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex11/other2.htm

3) Describe problem: Very simple question, I want to flash the border of 6 tables on one html page. All 6 are the same text and same colours. I did try and do this myself, I changed the id="myexample" in each repition of the code on my page but no luck.
Once I repeat the code again on the page the flashing stops.

I dare say its something simple to sort out but I'm stuck.

The text in a box is the same each time, so I guess there would be a simpler way to repeat the flashing box rather than using the same code over and over.

Best wishes

05-03-2007, 04:57 AM
Give this demo a shot. Let me know if you have questions:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<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;
<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){
var cacheobj=this;
var changebordercolor=function(el){
var el=el; el.style.borderColor=el.on=!el.on? flash_color : '';
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)
while (!document.all&&document.getElementById(id_base+i)!=null)
}; init(); };

<table id="flashtable0">
<td>Table 0</td>
<table id="flashtable1">
<td>Table 2</td>
<table id="ftable2s0">
<td>Table 2.0</td>
<table id="ftable2s1">
<td>Table 2.1</td>

<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)

02-22-2011, 01:19 AM
This script work in the div tag , but dont work in the table. Help please.Thank you.