A ver si te sirve algo así:
Código PHP:
<!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=iso-8859-1" />
<title>test</title>
<script>
function getElementPosition(elemID) {
var offsetTrail = document.getElementById(elemID);
var offsetLeft = 0;
var offsetTop = 0;
while (offsetTrail) {
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined" && navigator.appName=="Microsoft Internet Explorer" ) {
offsetLeft += parseInt(document.body.leftMargin);
offsetTop += parseInt(document.body.topMargin);
}
return {left:offsetLeft, top:offsetTop};
}
</script>
</head>
<body>
<div id="uno" style="border:1px solid #000000; cursor:pointer" onclick="alert('left:'+getElementPosition(this.id).left+',top:'+getElementPosition(this.id).top)">capa1</div><br />
<br />
<br />
<br />
<br />
<br />
<br />
<div id="dos" style="border:1px solid #000000; cursor:pointer" onclick="alert('left:'+getElementPosition(this.id).left+',top:'+getElementPosition(this.id).top)">capa2</div>
</body>
</html>