Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/02/2011, 14:14
Avatar de spicke23
spicke23
 
Fecha de Ingreso: septiembre-2005
Mensajes: 17
Antigüedad: 18 años, 7 meses
Puntos: 0
Respuesta: Agrandar caja con un click

Cita:
Iniciado por fherdoiza Ver Mensaje
Hola
Necesito saber como puedo agrandar una caja dandole un click
Mediante javascript
aquí está mi codigo:
Html:
<html>
<head><!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=utf-8" />
<title>Movimiento Recta</title>
<script type="text/javascript" src="js/cajagrande.js">
</script>
</head>
<body id="body">


<!--<div id="caja1"></div> -->
</body>
</html>


JavaScript:

window.onload=function(){
var x = 20;
var box=document.createElement("div");
box.style.top="50px";
box.style.left="50px";
box.style.width = x+"px";
box.style.height = x+"px";
box.style.backgroundColor = "blue";
box.style.position = "absolute";
document.getElementById("body").appendChild(box);

}

Gracias...
Que es lo que quieres realmente,por que con eso no entiendo lo que buscas