screenY只讀屬性返回的垂直距離,以像素為單位,從用戶的瀏覽器窗口到屏幕的上側(cè)的上邊框。
screenY屬性是較新的screenTop屬性的別名。
window.screenY
var win = window.open("", "popupWindow"); win.document.write("<p>This is 'popupWindow'"); win.document.write("<br>ScreenX: " + win.screenX); win.document.write("<br>ScreenY: " + win.screenY + "</p>");測試看看?/?
注意: screenX和screenY屬性等于screenLeft和screenTop屬性。
所有瀏覽器完全支持screenY屬性:
屬性 | ![]() | ![]() | ![]() | ![]() | ![]() |
screenY | 是 | 是 | 是 | 是 | 是 |
返回值: | 從瀏覽器視口的頂部邊緣到屏幕頂部的CSS像素?cái)?shù) |
---|
返回相對于屏幕的新窗口的x和y坐標(biāo):
var win = window.open("", "popupWindow", "left=500, top=350, width=300, height=200"); win.document.write("<p>This is 'popupWindow'"); win.document.write("<br>ScreenX: " + win.screenX); win.document.write("<br>ScreenY: " + win.screenY + "</p>");測試看看?/?
窗口(Window)參考:window.screenX屬性
窗口(Window)參考:window.screenTop屬性
窗口(Window)參考:window.screenLeft屬性