ウィンドウ画面Y
例1
指定された左右の位置で新しいウィンドウを開き、その座標を返します。
const myWin = window.open("", "", "left=700,top=350,width=200,height=100");
let x = myWin.screenX;
let y = myWin.screenY;
以下のその他の例。
定義と使用法
このscreenY
プロパティは、画面を基準にしたウィンドウのy(垂直)座標を返します。
構文
window.screenY
あるいは単に:
screenY
パラメーター
NONE |
戻り値
パラメータ | 説明 |
数 | 画面に対するウィンドウの垂直距離(ピクセル単位) |
その他の例
新しいウィンドウを開き、その座標を返します。
const myWin = window.open("", "", "width=200,height=100");
let x = myWin.screenX;
let y = myWin.screenY;
ブラウザのサポート
window.screenY
すべてのブラウザでサポートされています:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 10-11 | Yes | Yes | Yes | Yes |