Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/08/2009, 12:22
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Respuesta: posición de div

Hola

Prueba con esto

Código javascript:
Ver original
  1. PosElemento: function(elElem)  {
  2.     if (typeof elElem == "string")
  3.         elem = document.getElementById(elElem)
  4.             if (!elem) return { top:0,left:0 };
  5.         var y = 0;
  6.         var x = 0;
  7.             while (elem.offsetParent) {
  8.                     x += elem.offsetLeft;
  9.                     y += elem.offsetTop;
  10.                 elem = elem.offsetParent;
  11.      }
  12.     return {top:y,left:x};
  13.  
  14. }
  15.  
  16. posicionInicialLeft = parseInt(PosElemento.left);
  17. posicionInicialTop = parseInt(PosElemento.top);

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />