screenLeft, screenX, screenTop, screenY
In this chapter you will learn:
Window location
The following code determines the left and top positions of the window across browsers:
<!DOCTYPE HTML> <!-- jav a 2s . c om-->
<html>
<body>
<script type="text/javascript">
var leftPos = (typeof window.screenLeft == "number") ?
window.screenLeft :
window.screenX;
var topPos = (typeof window.screenTop == "number") ?
window.screenTop :
window.screenY;
document.writeln(leftPos);
document.writeln(topPos);
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » Window