天天看點

浏覽器對象

對象屬性無需聲明即可調用

浏覽器對象

屬性 

描述

window.innerheight 

視窗高度(不包括浏覽器邊欄和工具欄)(機關:像素)

window.innerwidth  

視窗寬度(不包括浏覽器邊欄和工具欄)(機關:像素)

window.pagexoffset

文檔滾動的水準距離(機關:像素)

window.pageyoffset  

文檔滾動的垂直距離(機關:像素)

window.screenx

滑鼠點的x坐标,相對于螢幕左上角(機關:像素)

window.screeny  

滑鼠點的y坐标,相對于螢幕左上角(機關:像素)

window.locationwindow 

對象的目前url(或本地檔案路徑)

window.document

指向document對象,代表視窗中的目前頁

window.histoy

指向視窗或标簽的hstoy對象,包含了在本頁測覽過的頁面的詳細資訊

window.history.length

浏覽器視窗或标簽的history對象中有多少項

window.screen 

指向screen對象

window.screen.width 

通路screen對象并找到width屬性的值(機關:像素)

window.screen.height 

通路screen對象并找到height屬性的值(機關:像素)

繼續閱讀