if you have element positioned absolutely EVEN THEN it is positioned relatively to container
see simple test
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<div id="testDiv" style="border:1px solid red; position:absolute; top:200px; left:200px; width:175px; height:200px">
<img src="http://s3.amazonaws.com/Rig/2_a.jpg" style="border:1px solid blue; position:absolute; top:0px; left:0px;">
</div>
<input type=button onclick="rePlace();" value="Re-place">
</body>
<script>
function rePlace()
{
document.getElementById('testDiv').style.left="0px";
document.getElementById('testDiv').style.top="0px";
}
</script>
</html>
Thursday, November 22, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment