Window screenY
示例 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
引數
無 |
返回值
引數 | 描述 |
一個數字 | 視窗相對於螢幕的垂直距離(以畫素為單位) |
更多示例
開啟一個新視窗並返回其座標
const myWin = window.open("", "", "width=200,height=100");
let x = myWin.screenX;
let y = myWin.screenY;
自己動手試一試 »
瀏覽器支援
window.screenY
在所有瀏覽器中都支援
Chrome | IE | Edge | Firefox | Safari | Opera |
是 | 10-11 | 是 | 是 | 是 | 是 |