Ver Mensaje Individual
  #6 (permalink)  
Antiguo 20/04/2009, 16:27
Avatar de alor86
alor86
 
Fecha de Ingreso: abril-2009
Mensajes: 110
Antigüedad: 15 años
Puntos: 5
De acuerdo Respuesta: Alargar div poco a poco

exactamente no tiene que ver con ajax. Para hacer el efecto que quieres tienes que usar intervalos te pongo el codigo de como lo deberia hacer espero y te sirva.

<html>

<head>
<script type="text/javaSCript">
var width=100;
var inter;
function ampliar(){
inter = setInterval(amplia,5);
}
function amplia(){
if(width<=500){
width+=10;
document.getElementById('x').style.width=width+'px ';
}
else{
clearInterval(inter);
}
}
</script>
</head>

<body>
<a href="javascript:ampliar()">ampliar</a>
<div id="x" style="width:100px;height:100px;border:solid 1px black">
</div>
</body>
</html>