Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/08/2009, 03:04
Avatar de susaninhax
susaninhax
 
Fecha de Ingreso: noviembre-2004
Mensajes: 358
Antigüedad: 19 años, 5 meses
Puntos: 3
Respuesta: mover una capa haciendo onclick

una ultima pregunta sobre esto, por si las moscas, este script lo veo perfectamente en explorer y en opera, pero no lo veo en firefox. Alguien sabría como solucionarlo??? thankiusss!!

Código HTML:
<!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>
    <title>[e7] movimiento capas </title>
  </head>
  
  <body>
  
  <a href="#" onclick="mueve_capa();">mover</a><br /><br />
  
    <div id="capa1" 
         style="LEFT: 50px; POSITION: absolute; TOP: 70px; WIDTH: 300px; 
                Z-INDEX: 2; BACKGROUND: #A0A0A0;">
    Bienvenidos a mi página
    </div>
    
    <script language='JavaScript' type="text/javascript">
//<![CDATA[
var posicionX=300;
var posicionY=50;
function mueve_capa() {
if (posicionX> 10) {
    posicionX=posicionX-5; 
    capa1.style.left=posicionX; 
    //posicionY=posicionY+1; 
//    capa1.style.top=posicionY;
}
setTimeout("mueve_capa()" ,2); 
return;
}

//setTimeout("mueve_capa()" , 2);
//]]>
</script>

  </body>
</html>