Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/02/2011, 09:58
annel_galvez
 
Fecha de Ingreso: agosto-2003
Ubicación: pachuca,hgo
Mensajes: 132
Antigüedad: 20 años, 9 meses
Puntos: 0
posicion de una DIV

Hola a todos... Tengo este codigo...

if (typeof(this.div) == 'undefined') {
this.div = document.createElement('DIV');
this.div.style.position = 'absolute';
this.div.style.display = 'none';
this.div.className = 'fc_main';
this.div.innerHTML = this.generateHTML();

this.div.style.left = fc_absoluteOffsetLeft(this.element);
this.div.style.top = fc_absoluteOffsetTop(this.element) + this.element.offsetHeight + 1;
document.body.appendChild(this.div);
}

Lo q hace es crearme una DIV y mostrarla en pantalla, con la funcion fc_absoluteOffsetLeft busco la posicion y se la asigno a this.div.style.left pero no me lo hace y lo q pienso es q no me esta llevando el valor de la variable left q se genera en dicha funcion que seria esta:

function fc_absoluteOffsetLeft(obj) {
var left = obj.offsetLeft;
var parent = obj.offsetParent;
while (parent != document.body) {
left += parent.offsetLeft;
parent = parent.offsetParent;
}
return left;
}

Algo estoy haciendo mal?...o como puedo hacer para llevarme el valor de left y asignarselo a this.div.style.left?
__________________
just do it