Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/09/2002, 12:20
Avatar de DragonX
DragonX
Colaborador
 
Fecha de Ingreso: mayo-2002
Ubicación: Funkyland
Mensajes: 8.433
Antigüedad: 21 años, 10 meses
Puntos: 177
Re: Celdas que cambian su fondo

esto en el head:

<script language="JavaScript1.2">

//Highlight Table Cells Script-- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TR"||source.tagName==& quot;TABLE")
return
while(source.tagName!="TD"&&sour ce.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor& &source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if
(ie&&(event.fromElement.contains(event.toE lement)||source.contains(event.toElement)||source. id=="ignore")||source.tagName=="TR& quot;||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&amp ;e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}

</script>

en el body:
<table onMouseover="changeto(event, 'lightgreen')" onMouseout="changeback(event, 'white')">
"
"
</table>

<a href='ir.asp?http://www.dynamicdrive.com' target='_blank'>http://www.dynamicdrive.com...</a>

Salu2 :cantar: