View Single Post
  #6 (permalink)  
Old February 14th, 2008, 12:35 PM
Andrew.Berry Andrew.Berry is offline
Authorized User
 
Join Date: Aug 2007
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Update:

New Code:
Code:
function startup(){
 StartFlashing();
}

function StartFlashing(){
var rowArray=document.getElementsByTagName('tr');
for (i=0;i<rowArray.length;i++)
{
if (rowArray[i].getAttribute('flash')=='true')
 {
 changeColour(rowArray[i]);
 }
 }

}

function changeColour(element) {
 var interval = 1000;
 var colour1 = "#ff0000";
 var colour2 = "#000000";
 if (document.getElementById) {
 element.style.color = (element.style.color == colour1) ? colour2 : colour1;
 setTimeout("changeColour('" + element + "')", interval);
 }
}
As I was having trouble passing my elementid in, instead I thought i'd pass the element.

Now the text will begin to flash (by turning red) but on the turn to colour2, it throws the following error: Style is null or not an object. Any clues?



Reply With Quote