Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/02/2008, 06:15
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Re: Posicion X de una capa segun resolucion de pantalla

Puedes usar una función como esta para obtener la posición:
Código PHP:
function getElementPosition(elem) {
var 
offsetTrail elem;
var 
offsetLeft 0;
var 
offsetTop 0;
while (
offsetTrail) {
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
offsetTrail offsetTrail.offsetParent;
}
if (
navigator.userAgent.indexOf("Mac") != -&& typeof document.body.leftMargin != "undefined" && navigator.appName=="Microsoft Internet Explorer" ) {
offsetLeft += parseInt(document.body.leftMargin);
offsetTop += parseInt(document.body.topMargin);
}
return {
left:offsetLefttop:offsetTop};
}
//uso: posicionX=getElementPosition(document.getElementById('idCapa')).left;