Ver Mensaje Individual
  #16 (permalink)  
Antiguo 17/12/2008, 09:31
carol1
 
Fecha de Ingreso: noviembre-2003
Mensajes: 18
Antigüedad: 21 años, 4 meses
Puntos: 0
Respuesta: Movimiento Parallax

Bueno, casi consigo lo que quiero con lo el código que me has mandado Panino, se mueve la capa donde tengo "logotype1.png" que queda al fondo del todo pero se quedan fijas las otras dos, no se como hacer para que "nubes.png" se muevan, y no es que no te entienda lo que dices pero es que no tengo ni idea de donde sale el movimiento de "logotype1.png" y creo que si no entiendo eso no entiendo nada. Te mando tu código modificado en plan chapucero por mi:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!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>
<style>
#externa{ width:600px; border:1px dashed #000; position:relative; overflow:hidden; height:150px}
#interna{ position:absolute;}

</style>
<script>
function t(id){return document.getElementById(id);}
function getStyle(id,w3cProp,IEProp){
if(window.getComputedStyle){
return document.defaultView.getComputedStyle(t(id),null). getPropertyValue(w3cProp);
}else if(t(id).currentStyle){
return t(id).currentStyle[IEProp];
}else{
alert('No se encontró el estilo');
}
}
onload=function(){
var p,m;
p=m=parseInt(getStyle('externa','width','width'));
setInterval(
function(){
if(window.parar)return;
if(p<=-t('interna').offsetWidth)
p=m;
p-=5;
t('interna').style.left=p+'px';
},100);

t('externa').onmouseover=function(){window.parar=1 ;}
t('externa').onmouseout=function(){window.parar=0; }
}
</script>
</head>
<body>
<div id="externa">
<div id="interna"><img src="logotype1.png" width="388" height="237"></div>
<div id="interna"><img src="fondoverde.gif" width="1200" height="150"></div>
<div id="interna"><img src="nubes.png" width="1200" height="150"></div>
</div>
</body>
</html>