Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/03/2013, 13:24
dehm
 
Fecha de Ingreso: septiembre-2010
Mensajes: 494
Antigüedad: 13 años, 7 meses
Puntos: 10
Usar getElementById() como valor de un miembro de un Array

Hola:

Pues esta es la duda. Estoy intentando crear un array/objeto (todavía no sé bien la diferencia entre ambos) de la siguiente forma:
Código:
var cuadro = {
						cuadro1	:	document.getElementById ("Cuadro1"),
						top	:       document.defaultView.getComputedStyle(cuadro1, '').getPropertyValue('top'),
						left	:	document.defaultView.getComputedStyle(cuadro1, '').getPropertyValue('left'),
						width	:	document.defaultView.getComputedStyle(cuadro1, '').getPropertyValue('width'),
						height	:	document.defaultView.getComputedStyle(cuadro1, '').getPropertyValue('height')
					};
Pero me sale el error:
Código:
Unhandled Error: Undefined variable: cuadro1
Entonces la duda es...¿es posible asignar un elemento referenciado con getElementById() como valor de un miembro del array?
Y si es posible, ¿de qué manera sería?

Muchas gracias por adelantado