After a little experimenting I think the problem is your use of setTimeout. If you move that into a separate function then it works:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>OnScroll Test</title>
<style type="text/css">
</style>
<script type="text/javascript">
function showScroll(x, y)
{
var oOutput = document.getElementById("divOutput");
oOutput.innerHTML += "screenX: " + x + ", screenY: " + y + "<br />";
}
function delayShowScroll()
{
setTimeout("showScroll(" + event.screenX + ", " + event.screenY + ")", 1000);
}
window.onscroll = delayShowScroll;
</script>
</head>
<body>
<div id="divOutput" style="border: 2px solid #c0c0c0; height: 600px; width: 200px; position: relative"></div>
</body>
</html>
--
Joe (
Microsoft MVP - XML)