Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

n4ndo

cores das células de uma tabela

Recommended Posts

<script language=javascript>var markedRow = new Array();function setPointer(theRow, thePointerColor, theNormalBgColor){	var theCells = null;	if (thePointerColor == '' || typeof(theRow.style) == 'undefined'){	//return false;	}	if (typeof(document.getElementsByTagName) != 'undefined') {	theCells = theRow.getElementsByTagName('td');	}else if (typeof(theRow.cells) != 'undefined'){  theCells = theRow.cells;  }else{  return false;	}		var rowCellsCnt  = theCells.length;	var currentColor = null;	var newColor     = null;	if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined'){  currentColor = theCells[0].getAttribute('bgcolor');  newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())  ? theNormalBgColor  : thePointerColor;  for(var c = 0; c < rowCellsCnt; c++){  theCells[c].setAttribute('bgcolor', newColor, 0);  }	}else{  currentColor = theCells[0].style.backgroundColor;  newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())  ? theNormalBgColor  : thePointerColor;  for(var c = 0; c < rowCellsCnt; c++){  theCells[c].style.backgroundColor = newColor;  }	}	return true;}efeito = " onmouseover=\"setPointer(this, 'C0D9D9', 'ffffff')\" onmouseout=\"setPointer(this, 'ffffff', 'C0D9D9')\"";html = "<table>";html += "<tr"+efeito+"><td>11111111111111111</td></tr>";html += "<tr"+efeito+"><td>22222222222222222</td></tr>";html += "<tr"+efeito+"><td>33333333333333333</td></tr>";html += "</table>";document.write(html);</script>

 

funciona no netscape tb

Compartilhar este post


Link para o post
Compartilhar em outros sites

no "terra compras" tem uns scripts muito mais simples, de duas linhas..mas testei em outros navegadores mas não funcionavam, só no IEesse que postei peguei do MyAdminSQL do PHP funciona tanto no IE quanto no NE

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.