Source Code: (back to article)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page-Side Coordinates Example</title>
</head>
<body style="height: 2000px;">
<div id="container" onclick="showPageCoords(event)">Click anywhere in this area to see Page-Side coordinates!</div>
<script>
function showPageCoords(event) {
alert("Page-Side X: " + event.pageX + ", Y: " + event.pageY);
}
</script>
</body>
<style>
#container {
width: 100%;
height: 100%;
background-color: grey;
min-height: 40px;
}
</style>
</html>