Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/06/2007, 22:41
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años, 8 meses
Puntos: 834
Re: Cambiar imagen fondo de DIV al pasar puntero

Otra manera:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>test</title>
<
script>
function 
addCss(cssCode) {
var 
styleElement document.createElement("style");
styleElement.type "text/css";
if (
styleElement.styleSheet) {
styleElement.styleSheet.cssText cssCode;
} else {
styleElement.appendChild(document.createTextNode(cssCode));
}
document.getElementsByTagName("head")[0].appendChild(styleElement);

</script>
</head>

<body>
<div id="pepe" onmouseover="addCss('#'+this.id+'{background:url(http://www.forosdelweb.com/customavatars/avatar65984_1.gif) center center no-repeat;}')" onmouseout="addCss('#'+this.id+'{background:none;}')"><br />
<br />
<br />
</div></body>
</html>