Fenêtre screenX et la propriété screenY
Définition et utilisation
screenX et screenY fenêtre rendements de propriété par rapport à la coordonnées X et Y de l'écran.
grammaire
window.screenX
window.screenY
window.screenY
support du navigateur
En plus d'Internet Explorer, tous les principaux navigateurs prennent en charge les propriétés screenX et screenY.
Remarque: les navigateurs IE." Window.screenLeft " et " window.screenTop " pour obtenir la même valeur
Exemples
Exemples
Renvoie une nouvelle fenêtre par rapport aux coordonnées X et Y de l'écran:
<html>
<head>
<script>
function openWin()
{
myWindow=window.open('','');
myWindow.document.write("<p>This is 'myWindow'");
myWindow.document.write("<br>ScreenX: " + myWindow.screenX);
myWindow.document.write("<br>ScreenY: " + myWindow.screenY + "</p>");
}
</script>
</head>
<body>
<input type="button" value="Open 'myWindow'" onclick="openWin()">
</body>
</html>
<head>
<script>
function openWin()
{
myWindow=window.open('','');
myWindow.document.write("<p>This is 'myWindow'");
myWindow.document.write("<br>ScreenX: " + myWindow.screenX);
myWindow.document.write("<br>ScreenY: " + myWindow.screenY + "</p>");
}
</script>
</head>
<body>
<input type="button" value="Open 'myWindow'" onclick="openWin()">
</body>
</html>
Essayez »
objet Window