首先,这是个痛苦的尝试。
在工作中尝试把一个FLASH居中全屏放置,窗口RESIZE的时候和页面SCROLL的时候都要动态变化,需要取得当前窗口显示区域的WIDTH与HEIGHT,翻了翻资料脑子就一半面一半水搅匀了。类似的参数我全列出来:
window.screen.width: | document.body.offsetWidth: | document.documentElement.offsetWidth: |
window.screen.height: | document.body.offsetHeight: | document.documentElement.offsetHeight: |
window.screen.availWidth: | document.body.scrollWidth: | document.documentElement.scrollWidth: |
window.screen.availHeight: | document.body.scrollHeight: | document.documentElement.scrollHeight: |
window.scrollMaxX: | document.body.scrollLeft: | document.documentElement.scrollLeft: |
window.scrollMaxY: | document.body.scrollTop: | document.documentElement.scrollTop: |
window.scrollX: | document.body.clientTop: | document.documentElement.clientTop: |
window.scrollY: | document.body.clientLeft: | document.documentElement.clientLeft: |
window.pageXOffset: | document.body.clientWidth: | document.documentElement.clientWidth: |
window.pageYOffset: | document.body.clientHeight: | document.documentElement.clientHeight: |
window.screenX: | document.width: | |
window.screenY: | document.height: | |
window.innerWidth: | ||
window.innerHeight: | ||
window.screen.availTop | ||
window.screen.availLeft |
而且我痛苦的发现,同一个属性,在不同的浏览器的JS取值是不一样的,甚至是无效的,就算都在IE中不同版本的值也不一样的,W3C的标准就从没被完整执行过,微软丈着本钱厚,肆意修改其定义,而且朝三暮四,同样一个事在版本升级时也搞出不同的标准来,一看开发组群就不是一个娘养的。
就在同一个版本同一浏览器中,标准模式与混杂模式的定义也大不相同,比如document.documentElement.scrollWidth和document.body.scrollWidth,在混杂模式中,后者有效前者无效,在标准模式中前者有效后者无效,直接让人崩溃。无奈之下,把这个参数用JS统一列出来,一个个做实验,这才做成了一个完整的结果。如下表,当然,这只是在标准模式下,混杂模式我一般不用,也没精力去研究了。
IE6 | IE8 | FF | OPREA | CHROME | |
window.screen.width: | 屏幕宽 | ||||
window.screen.height: | 屏幕高 | ||||
window.screen.availWidth: | 窗口最大化后宽度 | ||||
window.screen.availHeight: | 窗口最大后的高度 | ||||
window.scrollMaxX: | 最大横向滚动幅度,即BODY加左MARGIN减去窗口显示区不含滚动棒的宽度后的值 | ||||
window.scrollMaxY: | 最大纵向滚动幅度,即BODY加上下MARGIN减去窗口显示区不含滚动棒的高度后的值 | ||||
window.scrollX: | 左滚动值 | ||||
window.scrollY: | 上滚动值 | ||||
window.pageXOffset: | 左滚动值 | ||||
window.pageYOffset: | 上滚动值 | ||||
window.screenX: | 窗口左上角离屏幕左上角横向距离 | 标准模式下均为0. | 窗口左上角离屏幕左上角横向距离 | ||
window.screenY: | 窗口左上角离屏幕左上角纵向距离 | 标准模式下均为0. | 窗口左上角离屏幕左上角纵向距离 | ||
window.innerWidth: | 窗口显示区宽含滚动棒,同IE8的document.documentElement.offsetWidth: | ||||
window.innerHeight: | 窗口显示区高含滚动棒,同IE的document.documentElement.offsetHeight: | ||||
window.screen.availTop | 窗口最大化后的window.screenX: | 窗口最大化后的window.screenX: | |||
window.screen.availLeft | 窗口最大化后的window.screenY: | 窗口最大化后的window.screenY: | |||
document.body.offsetWidth: | 窗口显示区不含滚动棒宽度减去左右margin值后的数字/BODY宽度两者取大值 | 窗口显示区不含滚动棒宽度减左右MARGIN,最小为0 | |||
document.body.offsetHeight: | BODY高度,不含滚动棒与MARGIN | ||||
document.body.scrollWidth: | 同IE6的document.body.offsetWidth: | 同IE8,FF,oprea的document.body.offsetWidth: | 浏览器窗口的宽度,最小值取BODY加MARGINLEFT值,不含滚动棒 | ||
document.body.scrollHeight: | 同IE,FF,OPREA的document.body.offsetHeight: | BODY高度加MARGIN值/窗口显示区高度不含滚动棒取两者取其大 | |||
document.body.scrollLeft: | 标准模式下均为0. | 左滚动值 | |||
document.body.scrollTop: | 上滚动值 | ||||
document.body.clientTop: | 标准模式下均为0. | ||||
document.body.clientLeft: | 标准模式下均为0. | ||||
document.body.clientWidth: | 窗口显示区不含滚动棒宽度/BODY宽度两者之最大值 | 同IE8,FF,oprea的document.body.offsetWidth: | |||
document.body.clientHeight: | 同IE,FF,OPREA的document.body.offsetHeight: | ||||
document.documentElement.offsetWidth: | 窗口显示区的宽度,含滚动棒 | 浏览器窗口的宽度,不含滚动棒 | |||
document.documentElement.offsetHeight: | 窗口显示区的高度,含滚动棒 | BODY高度加MARGIN | |||
document.documentElement.scrollWidth: | 窗口显示区宽度不含滚动棒/BODY加两边MARGIN两者中大值 | 窗口显示区不含滚动棒宽度/BODY宽度加左GARGIN值两者中最大值 | |||
document.documentElement.scrollHeight: | BODY的高度 | BODY加上下MARGIN值 | 窗口显示区不含滚动棒高度/body加上下MARGIN两者中最大值 | 同IE8 | |
document.documentElement.scrollLeft: | 左滚动值 | 0 | |||
document.documentElement.scrollTop: | 上滚动值 | 0 | |||
document.documentElement.clientTop: | 2 | 标准模式下均为0. | |||
document.documentElement.clientLeft: | 2 | 标准模式下均为0. | |||
document.documentElement.clientWidth: | 窗口显示区的宽度,不含滚动棒 | ||||
document.documentElement.clientHeight: | 窗口显示区的高度,不含滚动棒 | ||||
document.width: | 同IE8,FF,oprea的document.body.offsetWidth: | 同document.body.scrollWidth | |||
document.height: | 同IE8,FF,oprea的document.body.offsetWidth: | document.body.scrollHeight |
dl.vmall.com/c0zqm8inbi
dl.vmall.com/c0w0oenyem
dl.vmall.com/c0l3edbgna
dl.vmall.com/c0dygc44sp
dl.vmall.com/c0k0ffdkci
dl.vmall.com/c0oy3blai5
dl.vmall.com/c03ys9vwbe
dl.vmall.com/c0fakujohy
dl.vmall.com/c09qbw7c8c
dl.vmall.com/c0lxuw4i9t
dl.vmall.com/c0xbmyz4gy
dl.vmall.com/c0arou0n1l
dl.vmall.com/c0eq0nx73x
dl.vmall.com/c0kgfmpuk1
dl.vmall.com/c00ik6fjhd
dl.vmall.com/c04xrlf4ua
dl.vmall.com/c0d2nw5mud
dl.vmall.com/c0has464kw
dl.vmall.com/c0olyj1hgv
dl.vmall.com/c09je73kot
dl.vmall.com/c0nve6it5z
dl.vmall.com/c0xuqf5awz
dl.vmall.com/c047x17tr7
dl.vmall.com/c0tm8dgqjb
dl.vmall.com/c0vr21tjfg
dl.vmall.com/c0lqmejw8k
dl.vmall.com/c0cizrb7oa
dl.vmall.com/c03hhi34ia
dl.vmall.com/c025762raw
dl.vmall.com/c0lyxspgeu
dl.vmall.com/c01lhtj7km
dl.vmall.com/c0rnsnmn9a
dl.vmall.com/c08adhw0to
dl.vmall.com/c0g2l7eswg
dl.vmall.com/c0l56xwz70
dl.vmall.com/c0glgt5ama
dl.vmall.com/c0au1sojmw
dl.vmall.com/c08ihmbioz
dl.vmall.com/c0obxnmt1b
dl.vmall.com/c0gqz2a0r9
dl.vmall.com/c0rsc47kuv
dl.vmall.com/c0ehokkqbq
dl.vmall.com/c0pd35gr6j
dl.vmall.com/c0kvyctg1g
dl.vmall.com/c0ed6rkkzd
dl.vmall.com/c0h5wk3vbj
dl.vmall.com/c011r2gcsz
dl.vmall.com/c0mkl9abnd
dl.vmall.com/c0rh7yoh2b
dl.vmall.com/c0tm9rzxhn
dl.vmall.com/c034ddltuo
dl.vmall.com/c0zqw4a4a1
dl.vmall.com/c01guogtdg
dl.vmall.com/c0ant8kpua
dl.vmall.com/c05pyd7p1l
dl.vmall.com/c0fmeqpgbh
dl.vmall.com/c0jsrtqitb
dl.vmall.com/c08mprcopr
dl.vmall.com/c0mbyq2r1k
dl.vmall.com/c0mgg7u53e
dl.vmall.com/c0yho1x35v
dl.vmall.com/c08iw7zrc0
dl.vmall.com/c0jfovmh1p
dl.vmall.com/c0advwm587
dl.vmall.com/c077u1o2s1
dl.vmall.com/c0jkhakbsg
dl.vmall.com/c0zqm02cay
dl.vmall.com/c00nd8pg7k
dl.vmall.com/c0af00irgq
dl.vmall.com/c0fzaedewk
dl.vmall.com/c0z9w1xis1
dl.vmall.com/c0clqobcx5
dl.vmall.com/c08qmgk3d0
dl.vmall.com/c0gvpua159
dl.vmall.com/c0oi8bhfy5
dl.vmall.com/c0v2j41lrz
dl.vmall.com/c0g67tqai2
dl.vmall.com/c0b58s34hv
dl.vmall.com/c01654smbb
dl.vmall.com/c0vpdy4trb
dl.vmall.com/c0bey4qoi1
dl.vmall.com/c0mk87sh1z
dl.vmall.com/c02y7ja2tc
dl.vmall.com/c0uicfnuw1
dl.vmall.com/c01qc71ds8
dl.vmall.com/c0iuu6xprl
dl.vmall.com/c0vwjwhhir
dl.vmall.com/c05w3jtvex
dl.vmall.com/c02gud4f3w
dl.vmall.com/c0oo1tuwxe
dl.vmall.com/c0em4c9w58
dl.vmall.com/c0sa4gdv2m
dl.vmall.com/c0g4zsm9g1
dl.vmall.com/c0s35opjjt
dl.vmall.com/c0uaxqgi7e
dl.vmall.com/c0sach3pam
dl.vmall.com/c04ultqijm
dl.vmall.com/c05h4zh4wz
dl.vmall.com/c0pasz5e2d
dl.vmall.com/c0eujca53n
dl.vmall.com/c057dnalny
dl.vmall.com/c0g9a8o41d
dl.vmall.com/c0o72lx7h0
dl.vmall.com/c0tvbz8bj4
dl.vmall.com/c0y0pom872
dl.vmall.com/c0ax0sgfnn
dl.vmall.com/c0xkj8w4z0
dl.vmall.com/c0hr6ty6av
dl.vmall.com/c0yququ2ix
dl.vmall.com/c0b9yu5yxw
dl.vmall.com/c0kg03s09c
dl.vmall.com/c0a89mlsua
dl.vmall.com/c0pkqqitzm
dl.vmall.com/c0druw2itf
dl.vmall.com/c0a64eup7s
dl.vmall.com/c0enutmrcj
dl.vmall.com/c0a4v73t6u
dl.vmall.com/c0x836bovz
dl.vmall.com/c05rwjv9r5
dl.vmall.com/c0q4ctvk77
dl.vmall.com/c0bvs7zqj3
dl.vmall.com/c0yaapqj5g
dl.vmall.com/c0gabgqua3
dl.vmall.com/c05ak290to
dl.vmall.com/c06r9ksj0b
dl.vmall.com/c0bulcj3w5
dl.vmall.com/c0fdlq30mu
dl.vmall.com/c0zbd4oy8g
dl.vmall.com/c0t4a6z0qa
dl.vmall.com/c04wgbm0g2
dl.vmall.com/c028rzaga5
dl.vmall.com/c0deira932
dl.vmall.com/c01oaghnlm
dl.vmall.com/c0ia2y4q8a
dl.vmall.com/c0aqb75aok
dl.vmall.com/c0nfmn3viy
dl.vmall.com/c0ykir5xox
dl.vmall.com/c0u609l47t
dl.vmall.com/c0vm9a6h0a
dl.vmall.com/c03o7e58nx
dl.vmall.com/c0g18387rb
dl.vmall.com/c0582200jh
dl.vmall.com/c0ux4nt24a
dl.vmall.com/c0tfh9ud6r
dl.vmall.com/c0drh9bmgm
dl.vmall.com/c0x8zj5ahx
dl.vmall.com/c0xbarkxqu
dl.vmall.com/c0yn7w3d3r
dl.vmall.com/c0ig81uxoq
dl.vmall.com/c0vcpshkhu
dl.vmall.com/c0ads5o21i
dl.vmall.com/c06hawvlj7
dl.vmall.com/c07k397ow8
dl.vmall.com/c0cwys3yg8
dl.vmall.com/c0gaboe2cr
dl.vmall.com/c02f2jfuaq
dl.vmall.com/c0awzol4b2
dl.vmall.com/c0hdpke9sf
dl.vmall.com/c0zfs8d47y
dl.vmall.com/c063emiwuq
dl.vmall.com/c0v2jbox1b
dl.vmall.com/c01nfg82z1
dl.vmall.com/c0zt4w9wx3
dl.vmall.com/c0hcxhwb2l
dl.vmall.com/c0jl82tryv
dl.vmall.com/c0vuvcjphy
dl.vmall.com/c0y3oj40uz
dl.vmall.com/c0e00ajoua
dl.vmall.com/c0rm7pu9co
dl.vmall.com/c0ceaua9l2
dl.vmall.com/c0trtd4dll
dl.vmall.com/c03wgiwhvx
dl.vmall.com/c00kc1klhj
dl.vmall.com/c05apzdu0g
dl.vmall.com/c07rzws8tq
dl.vmall.com/c0yepxazki
dl.vmall.com/c0x3yn4mnc
dl.vmall.com/c016ojaysb
dl.vmall.com/c0yzhrezi6
dl.vmall.com/c092oiwqvc
dl.vmall.com/c0017xrjth
dl.vmall.com/c0jutss7o0
dl.vmall.com/c0y56f6mjh
dl.vmall.com/c07utncmbi
dl.vmall.com/c0u0573vwp
dl.vmall.com/c0jr72ho27
dl.vmall.com/c0zdf35ywf
dl.vmall.com/c0a5dqubok
dl.vmall.com/c0qmbipla1
dl.vmall.com/c0lgl4wkbt
dl.vmall.com/c02moddb8f
dl.vmall.com/c0coxxtkh4
dl.vmall.com/c0xlswt8rz
dl.vmall.com/c06euv5bi6
dl.vmall.com/c0o058ai9r
dl.vmall.com/c0l2yh7gpk
dl.vmall.com/c0201cujh5
dl.vmall.com/c0hs3x4lxh
dl.vmall.com/c0twnw9nf6
dl.vmall.com/c0fra8bjqk
dl.vmall.com/c0rnq0tiin
dl.vmall.com/c0qnrwlyew
dl.vmall.com/c02t0zaea2
dl.vmall.com/c0qrq3j7m8
dl.vmall.com/c02m324lu5
dl.vmall.com/c0uko9uw4c
dl.vmall.com/c0hr4fa0rj
dl.vmall.com/c0k1ipamug
dl.vmall.com/c0cd9z00i3
dl.vmall.com/c0mdcuebm4
dl.vmall.com/c0jb0sh214
dl.vmall.com/c0jwx2bknq
dl.vmall.com/c00sahpped
dl.vmall.com/c0ok2b4yls
dl.vmall.com/c0694tcul3
dl.vmall.com/c09eq6774g
dl.vmall.com/c02sw18uyp
dl.vmall.com/c0znwz7ajc
dl.vmall.com/c0c5sxi9u6
dl.vmall.com/c0st8zl17o
dl.vmall.com/c0htsgzact
dl.vmall.com/c0mqb5werf
dl.vmall.com/c0q1z3g4wi
dl.vmall.com/c0nqkfwcer
dl.vmall.com/c0ho3o3v7j
dl.vmall.com/c03yxkz7rs
dl.vmall.com/c01sxy25fp
dl.vmall.com/c04u378bb2
dl.vmall.com/c0ixgynera
dl.vmall.com/c09aje1clj
dl.vmall.com/c0uozjadx4
dl.vmall.com/c0tknzh3tu
dl.vmall.com/c02sh0co6j
dl.vmall.com/c0faw6upl7
dl.vmall.com/c0aytt3pks
dl.vmall.com/c0of1mf2a3
dl.vmall.com/c0ju9ipr1y
dl.vmall.com/c03xwijnsx
dl.vmall.com/c0dx0zwaaq
dl.vmall.com/c0xsgtvbzz
dl.vmall.com/c0vkx3xdxk
dl.vmall.com/c0nj2vn5nt
dl.vmall.com/c0bes9fikn
dl.vmall.com/c02fzegnue
dl.vmall.com/c06dlvrgay
dl.vmall.com/c0tmqa8bvg
dl.vmall.com/c08ahcupa1
dl.vmall.com/c0fatrm011
dl.vmall.com/c0csxp3iv2
dl.vmall.com/c00qxj5wmi
dl.vmall.com/c0pqj648f3
dl.vmall.com/c06uvvxax8
dl.vmall.com/c04vfsyc6d
dl.vmall.com/c0fwwgwrqb
dl.vmall.com/c0x3z7uzdx
dl.vmall.com/c0yjdsi3wm
dl.vmall.com/c0fv45epsl
dl.vmall.com/c0f1clkr1n
dl.vmall.com/c0vqkg13co
dl.vmall.com/c0co2nv68z
dl.vmall.com/c0m5habdua
dl.vmall.com/c09ofrlara
dl.vmall.com/c0xjawr3pw
dl.vmall.com/c0jovf0wte
dl.vmall.com/c0wzdxg6mn
dl.vmall.com/c0hxfi87k6
dl.vmall.com/c0ai2a4i8f
dl.vmall.com/c0gm4rcg5h
dl.vmall.com/c0d1a2yrmr
dl.vmall.com/c0zu67p4fc
dl.vmall.com/c0tyvmbauj
dl.vmall.com/c06rk4wje0
dl.vmall.com/c0v0wy54hc