久艹网,亚洲一日韩欧美中文字幕2019,国产欧美日韩精品专区黑人,一区二区三区久久99

中山php|最優(yōu)網(wǎng)絡中山做網(wǎng)站 中山php建站

最優(yōu)良人

2011/09/23 at 17:46

JS獲取屏幕、瀏覽器、網(wǎng)頁的寬度,高度

網(wǎng)頁可見區(qū)域寬:document.body.clientWidth
網(wǎng)頁可見區(qū)域高:document.body.clientHeight
網(wǎng)頁可見區(qū)域寬:document.body.offsetWidth (包括邊線的寬)
網(wǎng)頁可見區(qū)域高:document.body.offsetHeight (包括邊線的寬)
網(wǎng)頁正文全文寬:document.body.scrollWidth
網(wǎng)頁正文全文高:document.body.scrollHeight
網(wǎng)頁被卷走的高:document.body.scrollTop
網(wǎng)頁被卷走的左:document.body.scrollLeft
網(wǎng)頁正文部分上:window.screenTop
網(wǎng)頁正文部分左:window.screenLeft
屏幕分辨率的高:window.screen.height
屏幕分辨率的寬:window.screen.width
屏幕可用勞動區(qū)高度:window.screen.availHeight
屏幕可用勞動區(qū)寬度:window.screen.availWidth

HTML正確定位:scrollLeft,scrollWidth,clientWidth,offsetWidth

scrollHeight: 獲取東西的轉動高度。

scrollLeft:設置或獲取位于東西左界限和窗口中目前可見內(nèi)容的最左端之間的間隔

scrollTop:設置或獲取位于東西最頂端和窗口中可見內(nèi)容的最頂端之間的間隔

scrollWidth:獲取東西的轉動寬度

offsetHeight:獲取東西盡對付版面或由父坐標 offsetParent 屬指定

的父坐標的高度

offsetLeft:獲取東西盡對付版面或由 offsetParent 屬指定的父坐標的計算左側地位

offsetTop:獲取東西盡對付版面或由 offsetTop 屬指定的父坐標的計算頂端地位

event.clientX 盡對文檔的程度座標

event.clientY 盡對文檔的筆挺座標

event.offsetX 盡對容器的程度坐標

event.offsetY 盡對容器的筆挺坐標

document.documentElement.scrollTop 筆挺偏向轉動的值

event.clientX+document.documentElement.scrollTop 盡對文檔的程度座標+筆挺偏向轉動的量

IE,F(xiàn)ireFox 差別如下:

IE6.0、FF1.06+:

clientWidth = width + padding

clientHeight = height + padding

offsetWidth = width + padding + border

offsetHeight = height + padding + border

IE5.0/5.5:
clientWidth = width - border

clientHeight = height - border

offsetWidth = width

offsetHeight = height

標簽:
-