Martin: Wo ist der document.body hingekommen?

Beitrag lesen

Hallo,

mir kommt da wo (im IE6) der document.body abhanden. Wo ist er hin? Bzw. was scrollt da jetzt, wenn nicht der body?

------------

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
Seitenbeginn
<div id=oDiv style="position:absolute; width:100px; height:100px; left: 400px; top: 900px; background-color:#FF0000" onClick=alert(document.body.scrollTop)>
</div>
</body>
</html>

Output: 148 (Wenn ich weit genug hinunterscrolle um zu clicken)

------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
Seitenbeginn
<div id=oDiv style="position:absolute; width:100px; height:100px; left: 400px; top: 900px; background-color:#FF0000" onClick=alert(document.body.scrollTop)>
</div>
</body>
</html>

Output: 0 (Wenn ich genau so weit gescrollt habe)

------------

Wie kann ich trotzdem feststellen, wie weit die Seite gescrollt worden ist?

Gruß und Dank

Martin