Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/12/2008, 13:33
ana_ramirez
 
Fecha de Ingreso: marzo-2007
Mensajes: 36
Antigüedad: 17 años, 1 mes
Puntos: 3
Es imposible?

Hola a todos

Quiero mover un div en la pantalla y para ello dispongo del siguiente codigo, que funciona correctamente en FF y en IE pero cuando incorporo un vinculo dentro del Div al pararme soble el vinculo la velocidad del movimiento del div varia y yo no quiero que esta se afecte.
Alguien puede ayudarme? Alguien sabe como hacerlo?
con saludos y respeto
Ana

El codigo:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<style type="text/css">
.propiedades {
position:absolute;
top:10px;
left:10px;
width:322px;
height:198px;
border:1px solid #000;
background-color:#f00;
}
</style>

<script type="text/javascript">

var c=10; /* intial starting position - equal to set css value */
var distance=400; /* a higher value produces a greater distance */
var speed=10; /* a higher value produces a slower speed */


function movediv(){
document.getElementById('mydiv').style.left=c+'px' ;
if(c>distance) {
clearTimeout(move);
return;
}
c++;
move=setTimeout('movediv()',speed);
}
</script>

</head>
<body>

<div class="propiedades" id="mydiv" onMouseOver="movediv()"><a href="#">aaaaaaa</a></div>


</body>
</html>