ie中:
document.body.clientwidth ==> body物件寬度
document.body.clientheight ==> body物件高度
document.documentelement.clientwidth ==> 可見區域寬度
document.documentelement.clientheight ==> 可見區域高度
firefox中:
document.body.clientwidth ==> body物件寬度
document.body.clientheight ==> body物件高度
document.documentelement.clientwidth ==> 可見區域寬度
document.documentelement.clientheight ==> 可見區域高度
opera中:
document.body.clientwidth ==> 可見區域寬度
document.body.clientheight ==> 可見區域高度
document.documentelement.clientwidth ==> 頁面物件寬度(即body物件寬度加上margin寬) document.documentelement.clientheight ==> 頁面物件高度(即body物件高度加上margin高)
沒有定義w3c的標準,
則 ie為:
document.documentelement.clientwidth ==> 0
document.documentelement.clientheight ==> 0
firefox為:
document.documentelement.clientwidth ==> 頁面物件寬度(即body物件寬度加上margin寬)
document.documentelement.clientheight ==> 頁面物件高度(即body物件高度加上margin高)
opera為:
document.documentelement.clientwidth ==> 頁面物件寬度(即body物件寬度加上margin寬)
document.documentelement.clientheight ==> 頁面物件高度(即body物件高度加上margin高)
網頁可見區域寬: document.body.clientwidth
網頁可見區域高: document.body.clientheight
網頁可見區域寬: document.body.offsetwidth (包括邊線的寬)
網頁可見區域高: document.body.offsetheight (包括邊線的高)
網頁正文全文寬: document.body.scrollwidth
網頁正文全文高: document.body.scrollheight
網頁被卷去的高: document.body.scrolltop
網頁被卷去的左: document.body.scrollleft
網頁正文部分上: window.screentop
網頁正文部分左: window.screenleft
螢幕解析度的高: window.screen.height
螢幕解析度的寬: window.screen.width
s html精確定位:scrollleft,scrollwidth,clientwidth,offsetwidth
scrollheight: 獲取物件的滾動高度。
scrollleft:設定或獲取位於物件左邊界和視窗中目前可見內容的最左端之間的距離
scrolltop:設定或獲取位於物件最頂端和視窗中可見內容的最頂端之間的距離
scrollwidth:獲取物件的滾動寬度
offsetheight:獲取物件相對於版面或由父座標
offsetparent 屬性指定的父座標的高度
offsetleft:獲取物件相對於版面或由
offsetparent 屬性指定的父座標的計算左側位置
offsettop:獲取物件相對於版面或由
offsettop 屬性指定的父座標的計算頂端位置
event.clientx 相對文件的水平座標
event.clienty 相對文件的垂直座標
event.offsetx 相對容器的水平座標
event.offsety 相對容器的垂直座標
document.documentelement.scrolltop 垂直方向滾動的值
event.clientx+document.documentelement.scrolltop 相對文件的水平座標+垂直方向滾動的量
實現**
< !doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> 請調整瀏覽器視窗
JS獲取瀏覽器的高度和寬度
ie中 document.body.clientwidth body物件寬度 document.body.clientheight body物件高度 document.documentelement.clientwidth 可見區域寬度 document.documentelement.client...
JS獲取螢幕,瀏覽器,網頁高度寬度
網頁可見區域寬 document.body.clientwidth 網頁可見區域高 document.body.clientheight 網頁可見區域寬 document.body.offsetwidth 包括邊線的寬 網頁可見區域高 document.body.offsetheight 包括邊線的...
jq獲取瀏覽器的高度
console.log 2 window height 瀏覽器當前視窗可視區域高度 console.log 3 document height 瀏覽器當前視窗文件的高度 console.log 4 document.body height 瀏覽器當前視窗文件body的高度 console.log 5...