Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/05/2012, 09:06
Avatar de mau_87lp
mau_87lp
 
Fecha de Ingreso: diciembre-2009
Ubicación: La Plata,Buenos Aires.
Mensajes: 72
Antigüedad: 14 años, 4 meses
Puntos: 3
Exclamación Problema al cambiar imagen de fondo en Google Chrome

Buenas, quiero a traves de javascript cambiar la imagen de fondo apretando en miniaturas de imagenes. Esto me funciona en IE8 pero cuando lo quiero probar en google chrome, al apretar en la miniatura para cambiar la imagen de fondo no hace nada.



Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>No Body Thinks</title>
<script language="JavaScript">
function tile(){
if (!document.all)
return
var source=event.srcElement
if (source.tagName=="IMG")
document.body.style.backgroundImage="url("+source.src+")"
document.body.style.backgroundRepeat="no-repeat"
document.body.style.backgroundAttachment="fixed"
document.body.style.backgroundPosition="center center"
}
</script>
<style type="text/css">
.bgimages img {
	cursor:hand;
	border:2 solid red;
}
</style>
</head>
<body>
<div id="cuerpo">
		<div>
			<div class="bgimages" onClick="tile()">
				<img src="http://st-listas.20minutos.es/images/2011-10/307413/3223568_640px.jpg?1321149309" border=0 width=100 height=100 alt="Background 1">
			</div>
		</div>
	</div>
</body>
</html> 
Muchas Gracias
Saludos

Última edición por mau_87lp; 16/05/2012 a las 09:46