Log in

View Full Version : Flashing Table Border HELP, PLEASE



MattyMan
09-07-2006, 10:54 PM
I used the following code from the OTHER Link on the home page: (SEE BELOW)

The issue I have is that I have 2 boxes on my Page that I tried to apply this to. I can get one to work but not both. IF set the intervals on both boxes to the same then neither work, IF I set the time intervals for each box Differently then it gives me a weird flash.

I did start by changing the id="myexample" to a different name on each box but still can not get it to work,

You can see it at: www.sultrynitesonline.com

Any help would be appreciated!!
Mattyman

<table border="0" width="280" id="myexample" style="border:5px solid green">
<tr>
<td>Insert anything you want into this table.<br>Insert anything you want into this table.<br>Insert anything you want into this table.<br></td>
</tr>
</table>
<script language="JavaScript1.2">
<!--

/*
Flashing Table Border Script- © Dynamic Drive (www.dynamicdrive.com)
Visit http://www.dynamicdrive.com for this script
Credit must stay intact for use
*/

//configure interval btw flash (1000=1 second)
var speed=500

function fla****(){
var crosstable=document.getElementById? document.getElementById("myexample") : document.all? document.all.myexample : ""
if (crosstable){
if (crosstable.style.borderColor.indexOf("green")!=-1)
crosstable.style.borderColor="red"
else
crosstable.style.borderColor="green"
}
}
setInterval("fla****()", speed)
//-->
</script>

ItsMeOnly
09-08-2006, 03:20 PM
it works, just changes every 1 MILIsecond :)

Is that a new, elaborate spam or something, btw: not my kind of site to visit....

MattyMan
09-09-2006, 12:04 AM
OK, If that is the case then how do I get it so they both flash the way the sales item flashes??

ItsMeOnly
09-09-2006, 12:35 AM
change the myexaple to something more ingeneous
second: function fla****() can be written to take argument, and that argument can be element id ("myexample" here)

function fla***(object) {
[...]
var object;
var crosstable=document.getElementById? document.getElementById(object) : document.all? document.all.object : ""
[...]
setInterval("fla****("+object+")", speed);
}

now just call the function twice with parameters (arguments) like names of your tables....

fla****("mytable1");
fla****("mytable2");