<!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>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1" />
<meta name="ProgId" content="VisualStudio.HTML"/>
<meta name="Originator" content="Microsoft Visual Studio .NET 7.1"/>
<script language="javascript">
function GetAbsoluteLocationEx(element){
var coords = { x: 0, y: 0};
while(element){
coords.x += element.offsetLeft;
coords.y += element.offsetTop;
element = element.offsetParent;
}
return coords;
}
function showAxis(element){
var coords = GetAbsoluteLocationEx(element);
var div = document.createElement("DIV");
with(div.style){
position = "absolute";
left = coords.x + "px";
top = (coords.y + element.offsetWidth) + "px";
border = "1px solid red";
backgroundColor = "white";
zIndex = 1000;
}
div.innerHTML = "AAAAAAAAAAAAAAA";
document.body.appendChild(div);
}
</script>
</head>
<body style="margin:0px">
<div id="div1" style="z-index: 100; background-color: red; width: 100px; height: 100px" onclick="showAxis(this);">1</div>
<div id="div2" style="z-index: 200; background-color: green; width: 100px; height: 100px" onclick="showAxis(this);">2</div>
<div id="Div3" style="position: absolute; top: 100px; left: 400px; z-index: 300; background-color: red; width: 100px; height: 100px" onclick="showAxis(this);">3
<div id="Div4" style="z-index: 400; background-color: green; width: 50px; height: 50px; left: 10px; top; 10px; position: relative" onclick="showAxis(this);">4</div>
</div>
</body>
</html>