Click to See Complete Forum and Search --> : is there any possible way to...


unwise
03-24-2003, 03:26 AM
Is there a way to make only cells in a certain "class" change color on mouseover with out having to modify the td tags? I want to know cuz I have a forum where I only have access to the headers and footers. the td clas I want to do this to is call "windowbg2". Is this possible at all?

unwise
03-24-2003, 08:04 AM
never mind, I just figured it out. I used this:

var mouseOverColor = '38434C';
tables = document.getElementsByTagName('TABLE');
for(t=0;t<tables.length;t++)
for(r=0;r<tables[t].rows.length; r++)
for (c=0;c<tables[t].rows(r).cells.length; c++)
highcel(tables[t],r,c);

function highcel(table,r,c) {
if(table.rows(r).cells(c).className=="windowbg2")
if(table.rows(r).cells(c).innerHTML.match(/^.*?href="(.+?)"/))
if(RegExp.$1 != 0) { table.rows(r).cells(c).id=RegExp.$1; table.rows(r).cells(c).onmouseover = function(){this.style.backgroundColor=mouseOverColor};
table.rows(r).cells(c).onmouseout = function(){this.style.backgroundColor=this.bgColor};
}
}