{"id":1907,"date":"2011-09-09T01:24:27","date_gmt":"2011-09-08T17:24:27","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907"},"modified":"2018-01-02T00:38:08","modified_gmt":"2018-01-01T16:38:08","slug":"cssom%e8%a7%86%e5%9b%be%e6%a8%a1%e5%bc%8fcssom-view-module%e7%9b%b8%e5%85%b3%e6%95%b4%e7%90%86%e4%b8%8e%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2011\/09\/cssom%e8%a7%86%e5%9b%be%e6%a8%a1%e5%bc%8fcssom-view-module%e7%9b%b8%e5%85%b3%e6%95%b4%e7%90%86%e4%b8%8e%e4%bb%8b%e7%bb%8d\/","title":{"rendered":"CSSOM\u89c6\u56fe\u6a21\u5f0f(CSSOM View Module)\u76f8\u5173\u6574\u7406"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907<\/a><\/p>\n<style>\ntd.comp{height:3em; text-align:center;}\n.params_table th{height:4em;}\ntd.no{background-color:#FCEAEA;}\ntd.yes{background-color:#EAFFE8;}\ntd.test{background-color:#ddd; color:#333; text-shadow:1px 1px #eee;}\ntd.incorrect{background-color:#fffff0; color:#f30;}\ntd.buggy{background-color:#FAD1C6; color:#f00;}\ntd.almost{background-color:#DEFCFA; color:#3B7F35;}\n<\/style>\n<p>\u5c31\u57288\u6708\u4efd\uff0c\u4e5f\u5c31\u662f\u4e0a\u6b21gf\u5927\u59e8\u5988\u6765\u7684\u65f6\u5019\uff0cW3C\u51fa\u7089\u4e86CSSOM\u89c6\u56fe\u6a21\u5757(CSS Object Model View)\u8349\u6848\u3002<a href=\"http:\/\/www.w3.org\/TR\/cssom-view\/\">CSSOM\u89c6\u56fe\u6a21\u5757(CSSOM View Module)<\/a>\u5b9a\u4e49\u4e86\u4e00\u4e9b API\uff0cWeb \u5f00\u53d1\u4eba\u5458\u4f7f\u7528\u8fd9\u4e9b API \u53ef\u4ee5\u8fdb\u884c\u68c0\u67e5\uff0c\u4e5f\u53ef\u4ee5\u4ee5\u7f16\u7a0b\u65b9\u5f0f\u66f4\u6539\u6587\u6863\u53ca\u5176\u5185\u5bb9\u7684\u89c6\u89c9\u5c5e\u6027\uff0c\u5305\u62ec\u5e03\u5c40\u6846\u5b9a\u4f4d\u3001\u89c6\u533a\u5bbd\u5ea6\u548c\u5143\u7d20\u6eda\u52a8\u3002<\/p>\n<p>\u4ee5\u4e0b\u5c31\u662f\u4e00\u4e9bAPI\u5c5e\u6027\u7684\u76f8\u5173\u5185\u5bb9\uff0c\u5305\u62ec\u517c\u5bb9\u6027\uff0c\u4f7f\u7528\uff0c\u6d4b\u8bd5\u7b49\u3002<\/p>\n<div class=\"hidden\"><strong>\u6ce8\u610f\uff1a<\/strong>\u8868\u683c\u542b\u6709\u8fb9\u6846\u4ee5\u53ca\u7279\u5b9a\u80cc\u666f\u8272\u6837\u5f0f\uff0c\u5982\u679c\u60a8\u662f\u5728RSS\u4e2d\u9605\u8bfb\u672c\u6587\uff0c\u53ef\u80fd\u4e00\u4e9b\u8868\u683c\u7684\u663e\u793a\u6548\u679c\u4e0d\u662f\u5f88\u597d\uff0c\u5efa\u8bae\u60a8\u70b9\u51fb<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907\">\u8fd9\u91cc<\/a>\u53bb\u539f\u51fa\u5904\u67e5\u770b\u672c\u6587\u5185\u5bb9\u3002<\/div>\n<h3>\u4e00\u3001Window\u89c6\u56fe\u5c5e\u6027<\/h3>\n<p>\u8fd9\u4e9b\u5c5e\u6027\u53ef\u4ee5hold\u4f4f\u6574\u4e2a\u6d4f\u89c8\u5668\u7a97\u4f53\u5927\u5c0f\u3002\u5fae\u8f6f\u5219\u5c06\u8fd9\u4e9bAPI\u79f0\u4e3a\u201cScreenview \u63a5\u53e3\u201d\u3002\u5305\u62ec\uff1a<br \/>\n    <code>innerWidth <\/code>\u5c5e\u6027\u548c <code>innerHeight<\/code> \u5c5e\u6027<br \/>\n    <code>pageXOffset <\/code>\u5c5e\u6027\u548c <code>pageYOffset <\/code>\u5c5e\u6027<br \/>\n    <code>screenX <\/code>\u5c5e\u6027\u548c <code>screenY <\/code>\u5c5e\u6027<br \/>\n    <code>outerWidth <\/code>\u5c5e\u6027\u548c <code>outerHeight <\/code>\u5c5e\u6027<\/p>\n<p>\u76f8\u5173\u5c5e\u6027\u7ec4\u5bf9\u5e94\u7684\u517c\u5bb9\u6027\u4ee5\u53ca\u4f7f\u7528\u89c1\u4e0b\u9762\u3002<\/p>\n<p><strong>1. innerWidth \u5c5e\u6027\u548cinnerHeight \u5c5e\u6027<\/strong><br \/>\n\u4f8b\u5982<code>innerWidth<\/code>\u8868\u793a\u83b7\u53d6window\u7a97\u4f53\u7684\u5185\u90e8\u5bbd\u5ea6\uff0c\u4e0d\u5305\u62ec\u7528\u6237\u754c\u9762\u5143\u7d20\uff0c\u6bd4\u5982\u7a97\u6846\u3002\u517c\u5bb9\u6027\u5982\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">innerWidth \u5c5e\u6027\u548cinnerHeight \u5c5e\u6027<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"4\" class=\"comp no\" title=\"IE 5.5; IE 6; IE 7; IE8\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td class=\"comp yes\" title=\"IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u5982\u4e0b\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>window.innerWidth\nwindow.innerHeight<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/innerheight-innerwidth.html\">innerWidth\/innerHeight\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u5bf9\u4e8e\u652f\u6301\u8be5\u5c5e\u6027\u7684\u6d4f\u89c8\u5668\uff08\u5982FireFox 6\uff09\u5f39\u51fa\u7684\u5c31\u662f\u7c7b\u4f3c\u4e0b\u9762\u7684\u7ed3\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u652f\u6301innerWidth\u5c5e\u6027\u6d4f\u89c8\u5668\u4e0b\u5f39\u51fa\u7684\u7ed3\u679c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_155426.png\" title=\"\u652f\u6301innerWidth\u5c5e\u6027\u6d4f\u89c8\u5668\u4e0b\u5f39\u51fa\u7684\u7ed3\u679c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"280\" height=\"182\" \/><\/p>\n<p>\u800c\u4e0d\u652f\u6301\u7684\u6d4f\u89c8\u5668\u5219\u5f39\u51fa\u7684\u662f<code>undefined<\/code>\uff0c\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_155454.png\" title=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"191\" height=\"199\" \/><\/p>\n<p><code>innerWidth<\/code>\u548c<code>innerHeight<\/code>\u5c5e\u6027\u53ea\u8bfb\uff0c\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002<\/p>\n<p><strong>2. outerWidth\u5c5e\u6027\u548couterHeight\u5c5e\u6027<\/strong><br \/>\n\u4f8b\u5982<code>outerWidth\/outerHeight<\/code>\u8868\u793a\u6574\u4e2a\u6d4f\u89c8\u5668\u7a97\u4f53\u7684\u5927\u5c0f\uff0c\u5305\u62ec\u4efb\u52a1\u680f\u7b49\u3002<\/p>\n<p>\u517c\u5bb9\u6027\u4e0e<code>innerWidth\/outerHeight<\/code>\u4e00\u81f4\u3002\u89c1\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">outerWidth\u5c5e\u6027\u548couterHeight\u5c5e\u6027<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"4\" class=\"comp no\" title=\"IE 5.5; IE 6; IE 7; IE8\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td class=\"comp yes\" title=\"IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u5982\u4e0b\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>window.outerWidth\nwindow.outerHeight<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/outerheight-outerwidth.html\">outerWidth\/outerHeight\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u5bf9\u4e8e\u652f\u6301\u8be5\u5c5e\u6027\u7684\u6d4f\u89c8\u5668\uff08\u5982FireFox 6\uff09\u5f39\u51fa\u7684\u5c31\u662f\u7c7b\u4f3c\u4e0b\u9762\u7684\u7ed3\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u652f\u6301outerWidth\u5c5e\u6027\u7684\u6d4f\u89c8\u5668\u5f39\u51fa\u7ed3\u679c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_165010.png\" title=\"\u652f\u6301outerWidth\u5c5e\u6027\u7684\u6d4f\u89c8\u5668\u5f39\u51fa\u7ed3\u679c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"277\" height=\"185\" \/><\/p>\n<p>\u800c\u4e0d\u652f\u6301\u7684\u6d4f\u89c8\u5668\u5219\u5f39\u51fa\u7684\u662fundefined\uff0c\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_155454.png\" title=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"191\" height=\"199\" \/><\/p>\n<p><code>outerWidth<\/code>\u548c<code>outerHeight<\/code>\u5c5e\u6027\u53ea\u8bfb\uff0c\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002<\/p>\n<p><strong>3. pageXOffset\u548cpageYOffset<\/strong><br \/>\n\u8868\u793a\u6574\u4e2a\u9875\u9762\u6eda\u52a8\u7684\u50cf\u7d20\u503c\uff08\u6c34\u5e73\u65b9\u5411\u7684\u548c\u5782\u76f4\u65b9\u5411\u7684\uff09\u3002\u8be5\u5c5e\u6027\u517c\u5bb9\u6027\u5982\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">pageXOffset\u5c5e\u6027\u548cpageYOffset\u5c5e\u6027<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"4\" class=\"comp no\" title=\"IE 5.5; IE 6; IE 7; IE8\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td class=\"comp yes\" title=\"IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u5982\u4e0b\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>window.pageXOffset\nwindow.pageYOffset<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/pagexoffset-pageyoffset.html\">pageXOffset\/pageYOffset\u4f7f\u7528\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u5bf9\u4e8e\u652f\u6301\u8be5\u5c5e\u6027\u7684\u6d4f\u89c8\u5668\uff08\u5982FireFox 6\uff09\u5f39\u51fa\u7684\u5c31\u662f\u7c7b\u4f3c\u4e0b\u9762\u7684\u7ed3\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"pageXOffset\u652f\u6301\u6d4f\u89c8\u5668demo\u9875\u9762\u5f39\u51fa\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_185138.png\" title=\"pageXOffset\u652f\u6301\u6d4f\u89c8\u5668demo\u9875\u9762\u5f39\u51fa\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"282\" height=\"186\" \/><\/p>\n<p>\u800c\u4e0d\u652f\u6301\u7684\u6d4f\u89c8\u5668\u5219\u5f39\u51fa\u7684\u662f<code>undefined<\/code>\uff0c\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_155454.png\" title=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"191\" height=\"199\" \/><\/p>\n<p>pageXOffset\u548cpageYOffset\u5c5e\u6027\u53ea\u8bfb\uff0c\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002<\/p>\n<p><strong>4. screenX and screenY<\/strong><br \/>\n\u6d4f\u89c8\u5668\u7a97\u53e3\u5728\u663e\u793a\u5668\u4e2d\u7684\u4f4d\u7f6e\uff0c<code>screenX<\/code>\u8868\u793a\u6c34\u5e73\u4f4d\u7f6e\uff0c<code>screenY<\/code>\u8868\u793a\u5782\u76f4\u4f4d\u7f6e\u3002\u8be5\u5c5e\u6027\u517c\u5bb9\u6027\u5982\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">screenX\u5c5e\u6027\u548cscreenY\u5c5e\u6027<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"4\" class=\"comp no\" title=\"IE 5.5; IE 6; IE 7; IE8\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td class=\"comp yes\" title=\"IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp incorrect\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\">\u4e0d\u6b63\u786e<\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u76f8\u5173\u4f7f\u7528\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>window.screenX\nwindow.screenY<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/screenx-screeny.html\">screenX\/screenY\u5c5e\u6027demo<\/a><\/p>\n<p>\u5bf9\u4e8e\u652f\u6301\u7684\u6d4f\u89c8\u5668\uff0c\u4f8b\u5982FireFox 6\uff0c\u6d4f\u89c8\u5668\u5168\u5c4f\u65f6\u5019\u5f39\u51fa\u7684\u5c31\u662f\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"screenX\u5728FireFox6\u4e0b\u7684\u5f39\u51fa\u793a\u4f8b  \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_235508.png\" title=\"screenX\u5728FireFox6\u4e0b\u7684\u5f39\u51fa\u793a\u4f8b  \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"281\" height=\"183\" \/><\/p>\n<p>\u800c\u4e0d\u652f\u6301\u7684\u6d4f\u89c8\u5668\u5219\u5f39\u51fa\u7684\u662f<code>undefined<\/code>\uff0c\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-05_155454.png\" title=\"\u5f39\u51faundefined \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"191\" height=\"199\" \/><\/p>\n<p>\u5bf9\u4e8eOpera\u6d4f\u89c8\u5668\uff0c\u5bf9\u8be5\u5c5e\u6027\u7684\u7406\u89e3\u4f3c\u4e4e\u662f\u4e0d\u6b63\u786e\u7684\u3002\u6211\u7528Opera 11.51\u6d4b\u8bd5\uff0c\u53d1\u73b0\u65e0\u8bba\u6d4f\u89c8\u5668\u7a97\u53e3\u65f6\u5168\u5c4f\u8fd8\u662f\u6b63\u5e38\u5927\u5c0f\u72b6\u6001\uff0c<code>window.screenX<\/code>\u548c<code>window.screenY<\/code>\u7684\u503c\u90fd\u662f<code>0<\/code>\u8fd9\u4e2a\u54b8\u9e2d\u86cb\uff0c\u5982\u4e0b\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"Opera\u6d4f\u89c8\u5668\u4e0bscreenX\u6b7b\u6d3b\u90fd\u663e\u793a0\u7684\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_000030.png\" title=\"Opera\u6d4f\u89c8\u5668\u4e0bscreenX\u6b7b\u6d3b\u90fd\u663e\u793a0\u7684\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"332\" height=\"172\" \/><\/p>\n<p>\u5728\u4e8b\u4ef6\u4e2d\uff0c\u8be5\u5c5e\u6027\u5728IE4\u90a3\u4f1a\u513f\u662f\u53ea\u8bfb\u7684\uff0cIE5\u4ee5\u53ca\u540e\u6765\u7684\u7248\u672c\u5373\u53ef\u4ee5\u8bfb\uff0c\u6709\u53ef\u4ee5\u5199\u3002\u5f53\u4f5c\u4e3awindow\u5c5e\u6027\u7684\u65f6\u5019\uff0c\u662f\u53ea\u8bfb\u7684\u3002<\/p>\n<h3>\u4e8c\u3001Screen\u89c6\u56fe\u5c5e\u6027<\/h3>\n<p>\u6307\u80fdhold\u4f4f\u663e\u793a\u5668\u4fe1\u606f\u7684\u4e9b\u5c5e\u6027\u3002\u6709\uff1a<br \/>\n<code>availWidth<\/code>\u548c<code>availHeight<\/code><br \/>\n<code>colorDepth<\/code><br \/>\n<code>pixelDepth<\/code><br \/>\n<code>width<\/code>\u548c<code>height<\/code><\/p>\n<p>\u8fd9\u7c7bAPI\u53c8\u88ab\u79f0\u4e3a\u201cScreen \u63a5\u53e3\u201d\u3002\u76f8\u5173\u517c\u5bb9\u6027\u4e0e\u7279\u6027\u4f9d\u6b21\u89c1\u4e0b\u9762\u5185\u5bb9\uff1a<\/p>\n<p><strong>1. availWidth\u548cavailHeight<\/strong><br \/>\n\u663e\u793a\u5668\u53ef\u7528\u5bbd\u9ad8\uff0c\u4e0d\u5305\u62ec\u4efb\u52a1\u680f\u4e4b\u7c7b\u7684\u4e1c\u4e1c\u3002\u8fd9\u5bf9\u5c5e\u6027\u7684\u517c\u5bb9\u6027\u89c1\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">availWidth\u5c5e\u6027\u548cavailHeight\u5c5e\u6027<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4ece\u4e0a\u8868\u53ef\u4ee5\u770b\u51fa\u8fd9\u4e24\u4e2a\u5c5e\u6027\u7684\u517c\u5bb9\u6027\u8fd8\u662f\u5f88\u8ba9\u4eba\u6b23\u6170\u7684\u3002<\/p>\n<p>\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>screen.availWidth\nscreen.availHeight<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/availwidth-availheight.html\">availWidth\u548cavailHeight\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u5404\u4e2a\u6d4f\u89c8\u5668\u90fd\u652f\u6301\u8be5\u5c5e\u6027\uff0c\u4f8b\u5982\u4e0a\u9762\u4e00\u76f4\u5f53\u89c2\u4f17\u7684IE7\u6d4f\u89c8\u5668\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"IE7\u6d4f\u89c8\u5668\u4e0bscreen.availWidth\u5f39\u51fa\u7ed3\u679c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_003038.png\" title=\"IE7\u6d4f\u89c8\u5668\u4e0bscreen.availWidth\u5f39\u51fa\u7ed3\u679c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"188\" height=\"216\" \/><\/p>\n<p><strong>2. colorDepth<\/strong><br \/>\n\u8868\u793a\u663e\u793a\u5668\u7684\u989c\u8272\u6df1\u5ea6\u3002\u517c\u5bb9\u6027\u53c2\u89c1\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">colorDepth<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"FF 3.0; FF 3.5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp incorrect\" title=\"FF 3.6; FF 4b1\">\u4e0d\u6b63\u786e<\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>screen.colorDepth<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/color-depth.html\">screen.colorDepth\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u4e00\u822c\u6d4f\u89c8\u5668\uff08\u5305\u62ec\u4f4e\u7248\u672cIE\uff09\u90fd\u8fd4\u56de<code>32<\/code>\uff0c\u56e0\u4e3a\u73b0\u5728\u7684\u6d4f\u89c8\u5668\u4e00\u822c\u90fd\u652f\u6301\u900f\u660e\u901a\u9053\u7684\u3002\u4f46\u662f\uff0cFireFox 3.6 \u4e00\u76f4\u5230\u73b0\u5728\u7684FireFox 6\u6d4f\u89c8\u5668<code>screen.colorDepth<\/code>\u8fd4\u56de\u7684\u5374\u662f24\u3002\u8fd9\u8ba9\u6211\u6709\u70b9\u60f3\u8d77\u4e86photoshop\u4e2d\u5b58\u50a8\u56fe\u7247\u65f6\u5019\u4fdd\u5b58\u4e3apng24\u7684\u9009\u9879\uff0c\u867d\u8bf4\u662fpng 24\uff0c\u4f46\u662f\u5b9e\u9645\u4e0a\u662fpng 32 \u7684\u652f\u6301\u900f\u660e\u901a\u9053\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"FireFox6\u4e0bscreen.colorDepth\u8fd4\u56de24\u7684\u7ed3\u679c\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_004742.png\" title=\"FireFox6\u4e0bscreen.colorDepth\u8fd4\u56de24\u7684\u7ed3\u679c\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"280\" height=\"194\" \/><\/p>\n<p>\u8fd9\u91cc\u5c31\u4e3a\u6211\u4eec\u5224\u65ad\u4e00\u4e2a\u6d4f\u89c8\u5668\u662f\u5426\u662f\u706b\u72d0\u6d4f\u89c8\u56683.6+\u7248\u672c\u63d0\u4f9b\u4e86\u7075\u611f\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>var $isFF = (screen.colorDepth === 24)? true: false;<\/pre>\n<\/div>\n<p><strong>3. pixelDepth<\/strong><br \/>\n\u8be5\u5c5e\u6027\u57fa\u672c\u4e0a\u4e0e<code>colorDepth<\/code>\u4e00\u6837\u3002\u5176\u517c\u5bb9\u6027\u5982\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">pixelDepth<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"4\" class=\"comp no\" title=\"IE 5.5; IE 6; IE 7; IE8\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td class=\"comp yes\" title=\"IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"FF 3.0; FF 3.5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp incorrect\" title=\"FF 3.6; FF 4b1\">\u4e0d\u6b63\u786e<\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f4e\u7248\u672cIE\u4e0d\u652f\u6301\u3002FireFox3.6+\u7248\u672c\u8fd4\u56de\u5185\u5bb9\u4e0d\u51c6\u786e\u3002\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>screen.pixelDepth<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/pixel-depth.html\">pixelDepth\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u9664\u4e86\u5728IE6~IE8\u6d4f\u89c8\u5668\u4e0b\u663e\u793a<code>undefined<\/code>\u5916\uff0c\u5176\u4ed6\u6d4f\u89c8\u5668\u7684\u5f39\u51fa\u7ed3\u679c\u8ddf\u4e0a\u9762<code>colorDepth<\/code>\u4e00\u81f4\uff0c\u8fd9\u91cc\u5c31\u4e0d\u91cd\u590d\u5c55\u793a\u56fe\u7247\u4e86\u3002<\/p>\n<p>pixelDepth\u548ccolorDepth\u7684\u4e0d\u540c\u4e4b\u5904\uff08\u4e0d\u786e\u5b9a\u65b0\u7684\u662f\u5426\u4e5f\u662f\u5982\u6b64\uff1f\uff09\u662f\u5728Unix\u673a\u5668\u4e0a\uff0c\u65e7\u7684X-\u5ba2\u6237\u7aef\u53ef\u4ee5\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u5b9a\u4e49\u5c5e\u4e8e\u81ea\u5df1\u7684\u989c\u8272\u7ec4\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c<code>colorDepth<\/code>\u5339\u914d\u5e94\u7528\u7a0b\u5e8f\u7684\u989c\u8272\u6df1\u5ea6\uff0c<code>pixelDepth<\/code>\u5339\u914d\u663e\u793a\u5668\u7684\u989c\u8272\u6df1\u5ea6\u3002\u5176\u4ed6\u6240\u6709\u60c5\u51b5\u4e0b\uff0c<code>pixelDepth<\/code>\u548c<code>colorDepth<\/code>\u662f\u4e92\u901a\u6709\u65e0\u7684\u3002<\/p>\n<p><strong>4. width\u548cheight<\/strong><br \/>\n\u8868\u793a\u663e\u793a\u5668\u5c4f\u5e55\u7684\u5bbd\u9ad8\u3002\u5176\u517c\u5bb9\u6027\u8fd8\u662f\u5f88\u4e0d\u9519\u7684\uff0c\u53c2\u89c1\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">width\u5c5e\u6027\u548cheight\u5c5e\u6027<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>screen.width\nscreen.height<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/screen-width-screen-height.html\">screen.width\/screen.height\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u4f8b\u5982\uff0c\u5728IE9\u6d4f\u89c8\u5668IE7\u6a21\u5f0f\u4e0b\u70b9\u51fb\u7b2c\u4e8c\u4e2a\u6309\u94ae\u5f39\u51fa\u4e0b\u56fe\u7ed3\u679c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"IE\u4e0bscreen.height\u9ad8\u5ea6\u5f39\u51fa\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_112648.png\" title=\"IE\u4e0bscreen.height\u9ad8\u5ea6\u5f39\u51fa\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"180\" height=\"212\" \/><\/p>\n<p>\u60f3\u5bf9\u5e94\u7684\u4e0a\u9762\u7684<code>screen.availHeight<\/code>\u7684\u503c\u4e3a\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"IE7\u6d4f\u89c8\u5668\u4e0bavailHeight\u9ad8\u5ea6\u5f39\u51fa\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_113015.png\" title=\"IE7\u6d4f\u89c8\u5668\u4e0bavailHeight\u9ad8\u5ea6\u5f39\u51fa\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"186\" height=\"213\" \/><\/p>\n<p>\u524d\u540e\u670940\u50cf\u7d20\u7684\u9ad8\u5ea6\u5dee\u5f02\uff0c\u8fd9\u4e2a\u5dee\u5f02\u5c31\u662f\u663e\u793a\u5668\u5e95\u90e8\u4efb\u52a1\u680f\u7684\u9ad8\u5ea6\u5dee\u5f02\u3002<\/p>\n<div class=\"hidden\"><em>\u5982\u679c\u60a8\u770b\u5230\u4e0b\u9762\u7684\u6587\u5b57\uff0c\u53ef\u80fd\u662f\u7531\u4e8e\u5728\u5176\u4ed6\u7f51\u7ad9\u6216\u662fRSS\u4e2d\u9605\u8bfb\u672c\u6587\uff0c\u672c\u6587\u539f\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907<\/a>\uff0c\u672c\u6587\u4f5c\u8005\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/\">\u5f20\u946b\u65ed<\/a>\uff0c\u6765\u81ea\u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\uff0c\u8bbf\u95ee\u539f\u51fa\u5904\u66f4\u591a\u7cbe\u5f69\u5185\u5bb9\u3002<\/em><\/div>\n<h3>\u4e09\u3001\u6587\u6863\u89c6\u56fe(DocumentView)\u548c\u5143\u7d20\u89c6\u56fe(ElementView)\u65b9\u6cd5<\/h3>\n<p>\u65d7\u4e0b\u6709\u56db\u4e2a\u65b9\u6cd5\uff0c\u5982\u4e0b\uff1a<br \/>\n<code>elementFromPoint()<\/code><br \/>\n<code>getBoundingClientRect()<\/code><br \/>\n<code>getClientRects()<\/code><br \/>\n<code>scrollIntoView()<\/code><\/p>\n<p><strong>1. elementFromPoint()<\/strong><br \/>\n\u8fd4\u56de\u7ed9\u5b9a\u5750\u6807\u5904\u6240\u5728\u7684\u5143\u7d20\u3002\u662f\u4e2a\u5728\u76ee\u524d\u800c\u8a00\uff0c\u517c\u5bb9\u6027\u4e0d\u9519\u7684\u65b9\u6cd5\uff0c\u89c1\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">elementFromPoint()<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp incorrect\" title=\"Saf 4.0 Win\">\u4e0d\u6b63\u786e<\/td>\n<td colspan=\"1\" class=\"comp yes\" title=\"Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp incorrect\" title=\"Opera 10.10\">\u4e0d\u6b63\u786e<\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u5982\u4e0b\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>document.elementFromPoint(100,100)<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/element-from-point.html\">elementFromPoint\u65b9\u6cd5demo<\/a><\/p>\n<p>\u70b9\u51fbdemo\u9875\u9762\u4e0a\u7684\u6309\u94ae\uff0c\u5728\u76f8\u5bf9\u9875\u9762\u5de6\u4e0a\u89d2<code>(100, 100)<\/code>\u5750\u6807\u5904\u7684\u5143\u7d20\u7684\u6587\u5b57\u989c\u8272\u53d8\u7ea2\u3002\u4e0d\u8fc7\uff0c\u901a\u8fc7\u5404\u4e2a\u6d4f\u89c8\u5668\u7684\u68c0\u6d4b\uff0c\u53d1\u73b0\u8fd8\u662f\u6709\u5dee\u5f02\u7684\u3002demo\u9875\u9762\u5782\u76f4\u65b9\u5411100\u50cf\u7d20\u6b63\u597d\u662f\u5927\u6807\u9898\u680f\u548c\u5c0f\u6807\u9898\u680f\u7684\u8fde\u63a5\u5904\u3002IE8+\u4ee5\u53ca\u5176\u4ed6\u6d4f\u89c8\u5668\u662f\u5c0f\u6807\u9898\u6587\u5b57\u989c\u8272\u53d8\u7ea2\uff0c\u800cIE7\u6d4f\u89c8\u5668\u5219\u662f\u5927\u6807\u9898\u680f\u6587\u5b57\u989c\u8272\u53d8\u7ea2\uff0c\u81f3\u4e8eIE6\u6d4f\u89c8\u5668\uff0c\u5728\u6211\u8fd9\u91cc\u770b\uff0c\u662f\u6e90\u4ee3\u7801\u5c55\u793a\u5904\u7684\u989c\u8272\u53d8\u7ea2\u4e86\u3002\u5982\u4e0b\u51e0\u4e2a\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"elementFromPoint\u6d4b\u8bd5\u9875\u9762\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_220336.png\" title=\"elementFromPoint\u6d4b\u8bd5\u9875\u9762\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"255\" height=\"152\" \/> <img loading=\"lazy\" decoding=\"async\" alt=\"\u6d4b\u8bd5demo\u9875\u9762\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_220428.png\" title=\"\u6d4b\u8bd5demo\u9875\u9762\u622a\u56fe\" class=\"alignnone\" width=\"451\" height=\"155\" \/> <img loading=\"lazy\" decoding=\"async\" alt=\"\u6d4b\u8bd5demo\u9875\u9762\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-06_220529.png\" title=\"\u6d4b\u8bd5demo\u9875\u9762\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"399\" height=\"202\" \/><\/p>\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u7528\u6765\u68c0\u6d4b\u5143\u7d20\u662f\u5426\u53d1\u751f\u91cd\u53e0\u6216\u662f\u78b0\u649e\u3002<\/p>\n<p><strong>2. getBoundingClientRect()<\/strong><br \/>\n\u5f97\u5230\u77e9\u5f62\u5143\u7d20\u7684\u754c\u7ebf\uff0c\u8fd4\u56de\u7684\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5305\u542b <code>top<\/code>, <code>left<\/code>, <code>right<\/code>, \u548c <code>bottom<\/code>\u56db\u4e2a\u5c5e\u6027\u503c\uff0c\u5927\u5c0f\u90fd\u662f\u76f8\u5bf9\u4e8e\u6587\u6863\u89c6\u56fe\u5de6\u4e0a\u89d2\u8ba1\u7b97\u800c\u6765\u3002\u8fd4\u56de\u5185\u5bb9\u7c7b\u4f3c\u4e8e\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>{\n    top: 143,\n    right: 1196,\n    bottom: 164,\n    left: 889\n}<\/pre>\n<\/div>\n<p>\u6211\u603b\u89c9\u5f97\u8be5\u65b9\u6cd5\u4e0eCSS\u4e2d\u7684<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1565\">clip:rect\u526a\u88c1\u5c5e\u6027<\/a>\u6709\u7740\u67d0\u4e9b\u9c9c\u4e3a\u4eba\u77e5\u7684\u74dc\u845b\u3002<\/p>\n<p>\u517c\u5bb9\u6027\u8fd8\u662f\u86ee\u4e0d\u9519\u7684\u3002\u6839\u636e<a href=\"http:\/\/www.quirksmode.org\/about\/\">Peter-Paul Koch<\/a>\u7684\u6d4b\u8bd5\uff0c\u5728FireFox 4\u53ca\u5176\u4ee5\u4e0b\u7248\u672c\u4ec5\u662f\u5927\u90e8\u5206\u652f\u6301\uff0c\u6309\u7167\u4ed6\u7684\u8bf4\u6cd5\uff0cFireFox\u6d4f\u89c8\u5668\u65e0\u6cd5\u641e\u5230\u5143\u7d20\u7684top\/bottom\u503c\u3002\u4e0d\u8fc7\uff0c\u6839\u636e\u6211\u5728FireFox 6\u4e0b\u7684\u6d4b\u8bd5\uff0c\u5143\u7d20\u504f\u79fb\u5ba2\u6237\u7aef\u7684\u4e0a\u4e0b\u503c\u662f\u53ef\u4ee5\u5f97\u5230\u7684\u3002\u6240\u4ee5\uff0c\u6709\u5982\u4e0b\u7565\u52a0\u4fee\u6539\u7684\u517c\u5bb9\u6027\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">getBoundingClientRect()<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>FF 6<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp almost\" title=\"FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/part.gif\" \/><\/td>\n<td colspan=\"1\" class=\"comp yes\" title=\"FF 6\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/get-bounding-client-rect.html\">getBoundingClientRect\u65b9\u6cd5demo<\/a><\/p>\n<p>\u70b9\u51fb\u6309\u94ae\u7070\u5f39\u51fa\u7c7b\u4f3c\u4e0b\u9762\u7684\u7ed3\u679c\uff0c\u5927\u5c0f\u56e0\u5f53\u524d\u4f7f\u7528\u5ba2\u6237\u7aef\u8bbe\u5907\u7684\u5927\u5c0f\u51b3\u5b9a\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u622a\u56fe\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-07_185758.png\" title=\"\u622a\u56fe\" class=\"alignnone\" width=\"333\" height=\"196\" \/><\/p>\n<p>\u8be5\u65b9\u6cd5\u4e0e\u4e0b\u9762\u5373\u5c06\u5c55\u793a\u7684<code>getClientRects()<\/code>\u65b9\u6cd5\u662f\u8fd1\u4eb2\uff0c\u4e24\u8005\u90fd\u4e3a\u201cRange\u63a5\u53e3\u201d\u65b9\u6cd5\u3002<\/p>\n<p><strong>3. getClientRects()<\/strong><br \/>\n\u8fd4\u56de\u5143\u7d20\u7684\u6570\u4e2a\u77e9\u5f62\u533a\u57df\uff0c\u8fd4\u56de\u7684\u7ed3\u679c\u662f\u4e2a\u5bf9\u8c61\u5217\u8868\uff0c\u5177\u6709\u6570\u7ec4\u7279\u6027\u3002\u8fd9\u91cc\u7684\u77e9\u5f62\u9009\u533a\u53ea\u9488\u5bf9inline box\uff0c\u56e0\u6b64\uff0c\u53ea\u9488\u5bf9<code>a, span, em<\/code>\u8fd9\u7c7b\u6807\u7b7e\u5143\u7d20\uff0c\u8fd9\u4e2a\u4e0b\u9762\u4f1a\u8be6\u7ec6\u8bb2\u8ff0\u3002\u9996\u5148\u770b\u770b\u8be5\u65b9\u6cd5\u7684\u517c\u5bb9\u6027\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">getClientRects()<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>FF 6<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"3\" class=\"comp buggy\" title=\"IE 5.5; IE 6; IE 7; \">\u6709bug<\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\" IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp almost\" title=\"FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/part.gif\" class=\"vimg\" \/> \u90e8\u5206\u652f\u6301<\/td>\n<td colspan=\"1\" class=\"comp yes\" title=\"FF 6\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/get-client-rects.html\">getClientRects\u65b9\u6cd5demo<\/a><\/p>\n<p>\u5bf9\u4e8e\u6309\u7167\u89c4\u8303\u6765\u8d70\u7684\u6d4f\u89c8\u5668\uff0c\u70b9\u51fbdemo\u9875\u9762\u53f3\u534a\u533a\u57df\u7684\u6587\u5b57\u90e8\u5206\uff0c\u5c31\u4f1a\u5f39\u51fa\u4e00\u4e9b\u6587\u5b57\uff08\u663e\u793a\u7684\u4e2a\u6570\u5c31\u662f\u6587\u5b57\u7684\u884c\u6570\uff09\uff0c\u4f8b\u5982\uff0c\u6211\u7684\u6d4f\u89c8\u5668\u4e0b\u5c31\u663e\u793a\u201c2\u4e2a\u77e9\u5f62\u201d\uff0c\u5982\u4e0b\u622a\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"FireFox 6\u4e0b\u5f39\u51fa2\u4e2a\u77e9\u5f62\u533a\u57df\u7684\u63d0\u793a \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_002401.png\" title=\"FireFox 6\u4e0b\u5f39\u51fa2\u4e2a\u77e9\u5f62\u533a\u57df\u7684\u63d0\u793a \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"572\" height=\"181\" \/><\/p>\n<p>\u4f46\u662f\uff0c\u5728\u4e0d\u51c6\u786e\u89e3\u6790\u7684IE7\u6d4f\u89c8\u5668\u4e0b\uff0c\u6211\u4e22\uff01\u5413\u7740\u6211\u654f\u611f\u8106\u5f31\u7684\u5c0f\u5fc3\u810f\u4e86\u2014\u2014\u5c45\u713644\u4e2a\u77e9\u5f62\u533a\u57df\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u5413\u6b7b\u4eba\u768444\u4e2a\u77e9\u5f62\u533a\u57df \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_002717.png\" title=\"\u5413\u6b7b\u4eba\u768444\u4e2a\u77e9\u5f62\u533a\u57df \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"493\" height=\"280\" \/><\/p>\n<p><strong>IE6, IE7\u4e0b\u7684bug<\/strong><br \/>\n<code>getClientRects()<\/code>\u65b9\u6cd5\u662f\u8ddf\u7740line box\u6a21\u578b\u8d70\u7684\uff0c\u5176\u8fd4\u56de\u7684\u6bcf\u4e2a\u77e9\u5f62\u533a\u57df\u6b67\u89c6\u5c31\u662f\u4e00\u4e2aline boxes\uff0c\u4e5f\u5c31\u662f\u4e00\u884c\u6587\u5b57\u5185\u5bb9\u3002\u5982\u679c\u60a8\u5bf9inline box\u6a21\u578b\u4e0d\u719f\u6089\uff0c\u53ef\u4ee5\u5728\u6211\u535a\u5ba2\u53f3\u4e0a\u533a\u57df\u7684\u641c\u7d22\u6846\u4e2d\u641c\u7d22\u201cinline box\u6a21\u578b\u201d\uff0c\u4f1a\u6709\u51e0\u4e2a\u76f8\u5173\u7684\u6587\u7ae0\uff0c\u91cc\u9762\u57fa\u672c\u4e0a\u90fd\u6709\u6240\u4ecb\u7ecd\u7684\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f8b\u5982\u4e00\u6bb5\u6587\u5b57\u5728\u4e00\u4e2a<code>span<\/code>\u6807\u7b7e\u4e0b\uff0c\u5982\u679c\u8fd9\u4e2a<code>span<\/code>\u6807\u7b7e\u5185\u7684\u6587\u5b57\u6709\u4e24\u884c\uff0c\u5219<code>getClientRects()<\/code>\u8fd4\u56de\u7684\u5c31\u662f\u542b\u6709\u4e24\u4e2aRect\u5bf9\u8c61\u7684\u5217\u8868\uff1b\u5982\u679c\u6587\u5b57\u662f\u4e09\u884c\u5c31\u4e09\u4e2a\u3002<\/p>\n<p>\u7136\u800c\uff0c\u5728IE6, IE7\u6d4f\u89c8\u5668\u4e0b\uff0c\u5176\u8fd4\u56de\u7684\u533a\u57df\u4e2a\u6570\u50cf\u5403\u4e86\u6fc0\u7d20\u4e00\u6837\uff0c\u5b8c\u5168\u4e0d\u53d7\u63a7\u5236\uff0c\u6570\u76ee\u591a\u5f97\u5f88\uff0c\u90fd\u4e0d\u77e5\u4ece\u54ea\u513f\u5192\u51fa\u6765\u7684\uff01<\/p>\n<p>IE6, IE7\u8fd8\u6709\u4e00\u4e2a\u6587\u5b57\uff0c\u5c31\u662f\u6309\u7167\u5b9a\u4e49\uff0c\u5982\u679c\u662fblock\u6c34\u5e73\u6807\u7b7e\u5185\u7684\u6587\u5b57\uff0c\u4e0d\u8fc7\u6587\u5b57\u6709\u591a\u5c11\u884c\uff0c\u8fd4\u56de\u7684\u90fd\u662f\u8fd9\u4e2ablock\u6c34\u5e73\u7684\u6807\u7b7e\u533a\u57df\u3002\u4f46\u662f\uff0cIE6, IE7\u5374\u4e0d\u8d70\u5bfb\u5e38\u8def\uff0c\u53cd\u800c\u201c\u6b63\u5e38\u6a21\u6837\u201d\u5730\u8fd4\u56de\u884c\u6570\u7b49\u3002\u4f8b\u5982\u4e0a\u9762\u7684demo\u9875\u9762\uff0c\u5982\u679c\u628a<code>span<\/code>\u6807\u7b7e\u6362\u6210<code>p<\/code>\u6807\u7b7e\uff0c\u5219\u5176\u4ed6\u6240\u6709\u6d4f\u89c8\u5668\u8fd4\u56de\u7684\u5217\u8868\u4e2a\u6570\u662f1\uff0c\u5c31IE6,IE7\u8fd4\u56de\u7684\u662f\u6587\u5b57\u884c\u6570\u76f8\u7b49\u7684\u77e9\u5f62\u533a\u57df\u3002<\/p>\n<p>\u603b\u7ed3\u4e3a\uff0cIE6, IE7\u628a\u9488\u5bf9inline\u6c34\u5e73\u6807\u7b7e\u7684\u65b9\u6cd5\u5e94\u7528\u5230block\u6c34\u5e73\u7684\u6807\u7b7e\u4e0a\u4e86\uff0c\u800cinline\u6c34\u5e73\u6807\u7b7e\u50cf\u5f03\u5a74\u4e00\u6837\uff0c\u4ecd\u5728\u4e00\u65c1\uff0cbug\u6a2a\u751f\u554a\u3002<\/p>\n<p><strong>getClientRects\u548cgetBoundingClientRect\u5dee\u5f02<\/strong><br \/>\n<code>getClientRects<\/code>\u8fd4\u56de\u7684\u5176\u5b9e\u662f\u4e2a\u6570\u7ec4\uff0c\u6570\u7ec4\u4e2d\u6709\u5f88\u591a\u4e2a\u7c7b\u4f3c<code>getBoundingClientRect<\/code>\u8fd4\u56de\u7684\u5bf9\u8c61\u3002<code>getBoundingClientRect<\/code>\u8fd4\u56de\u7684\u6c38\u8fdc\u662f\u6700\u5916\u6846\u6846\u7684\u90a3\u4e2a\u77e9\u5f62\u533a\u57df\u76f8\u5173\u7684\u5750\u6807\u504f\u79fb\u5bf9\u8c61\uff1b\u800c<code>getClientRects<\/code>\u662f\u591a\u884c\u6587\u5b57\u533a\u57df\u7684\u5750\u6807\u504f\u79fb\u96c6\u5408\uff0c\u5728\u975eIE\u6d4f\u89c8\u5668\u4e0b\uff0c\u53ea\u5bf9inline\u6c34\u5e73\u7684\u6807\u7b7e\u6709\u53cd\u5e94\u3002<\/p>\n<p>\u4e00\u822c<code>getBoundingClientRect<\/code>\u65b9\u6cd5\u7528\u7684\u591a\u4e00\u70b9\u3002\u6211\u4eec\u53ef\u4ee5\u5f88\u5bb9\u6613\u83b7\u53d6\u67d0\u4e2a\u5143\u7d20\u7684\u504f\u79fb\u503c\u3002\u751a\u81f3\u9ad8\u5bbd\u90fd\u80fd\u5f88\u8f7b\u677e\u7684\u8ba1\u7b97\u51fa\u6765\u3002\u6240\u4ee5\uff0c\u4e0b\u8f7d\u4f60\u60f3\u7528js\u83b7\u53d6\u5143\u7d20\u7684\u9ad8\u5bbd\u5c3a\u5bf8\uff0c\u5c31\u53ef\u4ee5\u8bd5\u8bd5<code>getBoundingClientRect<\/code>\u65b9\u6cd5\u4e86\u3002<\/p>\n<p><strong>4. scrollIntoView()<\/strong><br \/>\n\u8ba9\u5143\u7d20\u6eda\u52a8\u5230\u53ef\u89c6\u533a\u57df\uff08\u4e0d\u5c5e\u4e8e\u8349\u6848\u65b9\u6cd5\uff09\u3002\u517c\u5bb9\u6027\u5982\u4e0b\uff1a<br \/>\n m<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">scrollIntoView()<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u7b80\u5355\u5b9e\u7528\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>element.scrollIntoView()<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/scroll-into-view.html\">scrollIntoView\u65b9\u6cd5demo<\/a><\/p>\n<p>\u70b9\u51fbdemo\u9875\u9762\u4e0a\u7684\u6309\u94ae\uff0c\u9ad8\u9ad8\u56fe\u7247\u4e0b\u9762\u7684\u6709\u84dd\u8272\u7c97\u7cd9\u8d28\u611f\u80cc\u666f\u7684\u6846\u6846\u5c31\u663e\u793a\u51fa\u6765\u7684\u3002\u6b64\u65b9\u6cd5\u7684\u517c\u5bb9\u6027\u751a\u662f\u4e0d\u9519\u3002\u8fd9\u4e3a\u6211\u4eec\u5b9e\u73b0\u5143\u7d20\u7684\u951a\u70b9\u8df3\u8f6c\u529f\u80fd\u53c8\u655e\u5f00\u4e86\u53e6\u5916\u4e00\u6761\u9014\u5f84\u3002<\/p>\n<h3>\u56db\u3001\u5143\u7d20\u89c6\u56fe\u5c5e\u6027<\/h3>\n<p>\u5173\u4e8e\u5143\u7d20\u5927\u5c0f\u4f4d\u7f6e\u7b49\u4fe1\u606f\u7684\u4e00\u4e9b\u5c5e\u6027\u3002\u6709\uff1a<br \/>\n<code>clientLeft<\/code>\u548c<code>clientTop<\/code><br \/>\n<code>clientWidth<\/code>\u548c<code>clientHeight<\/code><br \/>\n<code>offsetLeft<\/code>\u548c<code>offsetTop<\/code><br \/>\n<code>offsetParent<\/code><br \/>\n<code>offsetWidth<\/code>\u548c<code>offsetHeight<\/code><br \/>\n<code>scrollLeft<\/code>\u548c<code>scrollTop<\/code><br \/>\n<code>scrollWidth<\/code>\u548c<code>scrollHeight<\/code><\/p>\n<p><strong>1. clientLeft\u548cclientTop<\/strong><br \/>\n\u8868\u793a\u5185\u5bb9\u533a\u57df\u7684\u5de6\u4e0a\u89d2\u76f8\u5bf9\u4e8e\u6574\u4e2a\u5143\u7d20\u5de6\u4e0a\u89d2\u7684\u4f4d\u7f6e\uff08\u5305\u62ec\u8fb9\u6846\uff09\u3002\u5176\u517c\u5bb9\u6027\u4e0d\u9519\uff0c\u5982\u4e0b\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">clientLeft\u548cclientTop<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/clientleft-clienttop.html\">clientLeft\/clientTop\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u53ef\u4ee5\u53d1\u73b0\uff0c\u5728FireFox\u6d4f\u89c8\u5668\u4ee5\u53caIE\u6d4f\u89c8\u5668\u4e0b\uff0c\u5f39\u51fa\u7684\u5927\u5c0f\u4e3a3\uff0c\u5728Chrome\u6d4f\u89c8\u5668\u4e0b\u5219\u662f2\uff0c\u8fd9\u662f\u56e0\u4e3aFF\u548cIE\u6d4f\u89c8\u5668\u7684\u6309\u94ae\u5728\u6211\u7684\u7cfb\u7edf\u4e0b\u7684\u67093\u50cf\u7d20\u5927\u5c0f\u7684\u8fb9\u6846\u503c\uff0c\u800cChrome\u7684\u8fb9\u6846\u5927\u5c0f\u53ea\u67092\u50cf\u7d20\u3002\u4e8e\u662f\u5c31\u6709\u4e2a\u4e0d\u540c\u7684\u5f39\u51fa\u7ed3\u679c\u3002\u5982\u4e0b\u622a\u56fe\u793a\u610f\uff0c\u9996\u5148\u662fFireFox6\u4e0b\u7684\u5f39\u51fa\u7ed3\u679c\u4ee5\u53ca\u901a\u8fc7FireBug\u67e5\u770b\u7684\u9ed8\u8ba4\u8fb9\u6846\u5927\u5c0f\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_211526.png\" title=\"\u5f39\u51fa\u7ed3\u679c3\" class=\"alignnone\" width=\"279\" height=\"185\" \/> <img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_211602.png\" title=\"\u8fb9\u6846\u5927\u5c0f3\" class=\"alignnone\" width=\"212\" height=\"111\" \/><\/p>\n<p>\u5bf9\u4e8eChrome\u6d4f\u89c8\u5668\uff0c\u5219\u4e3a\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"Chrome\u6d4f\u89c8\u5668\u4e0b\u7684\u663e\u793a\u4e3a2 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_211656.png\" title=\"Chrome\u6d4f\u89c8\u5668\u4e0b\u7684\u663e\u793a\u4e3a2 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"389\" height=\"177\" \/> <img loading=\"lazy\" decoding=\"async\" alt=\"Chrome\u6d4f\u89c8\u5668\u6309\u94ae\u8fb9\u6846\u5927\u5c0f\u4e3a2  \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_211727.png\" title=\"Chrome\u6d4f\u89c8\u5668\u6309\u94ae\u8fb9\u6846\u5927\u5c0f\u4e3a2  \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"261\" height=\"72\" \/><\/p>\n<p><strong>2. clientWidth\u548cclientHeight<\/strong><br \/>\n\u8868\u793a\u5185\u5bb9\u533a\u57df\u7684\u9ad8\u5ea6\u548c\u5bbd\u5ea6\uff0c\u5305\u62ecpadding\u5927\u5c0f\uff0c\u4f46\u662f\u4e0d\u5305\u62ec\u8fb9\u6846\u548c\u6eda\u52a8\u6761\u3002\u517c\u5bb9\u6027\u8ddf\u4e0a\u9762\u4e00\u6837\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">clientWidth\u548cclientHeight<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/clientwidth-clientheight.html\">clientWidth\/clientHeight\u5c5e\u6027demo<\/a><\/p>\n<p>\u70b9\u51fbdemo\u6309\u94ae\u8fd4\u56de\u6309\u94ae\u5185\u5bb9\u533a\u57df\u5c3a\u5bf8\uff0c\u4f8b\u5982IE9\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"IE9\u6d4f\u89c8\u5668\u4e0b\u8fd4\u56de\u7684\u6309\u94ae\u5185\u5bb9\u533a\u57df\u5c3a\u5bf8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_212713.png\" title=\"IE9\u6d4f\u89c8\u5668\u4e0b\u8fd4\u56de\u7684\u6309\u94ae\u5185\u5bb9\u533a\u57df\u5c3a\u5bf8 \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"395\" height=\"300\" \/><\/p>\n<p><strong>3. offsetLeft\u548coffsetTop<\/strong><br \/>\n\u8868\u793a\u76f8\u5bf9\u4e8e\u6700\u8fd1\u7684\u7956\u5148\u5b9a\u4f4d\u5143\u7d20\uff08CSS position \u5c5e\u6027\u88ab\u8bbe\u7f6e\u4e3a <code>relative<\/code>\u3001<code>absolute <\/code>\u6216 <code>fixed <\/code>\u7684\u5143\u7d20\uff09\u7684\u5de6\u53f3\u504f\u79fb\u503c\u3002\u517c\u5bb9\u6027\u5982\u4e0b\u8868\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">offsetLeft\u548coffsetTop<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/offsetleft-offsettop.html\">offsetLeft\/offsetTop\u5c5e\u6027demo<\/a><\/p>\n<p>demo\u9875\u9762\u4e0a\u6709\u4e24\u4e2a\u6309\u94ae\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cdemo\u9875\u9762\u6ca1\u6709\u5b9a\u4f4d\u5143\u7d20\uff0c\u6240\u4ee5\uff0c\u521d\u6b21\u8fdbdemo\u9875\u9762\uff0c\u70b9\u51fb\u7b2c\u4e00\u4e2a\u6309\u94ae\uff0c\u8fd4\u56de\u7684\u504f\u79fb\u8ddd\u79bb\u65f6\u76f8\u5bf9\u4e8ehtml\u6587\u6863\u5de6\u4e0a\u89d2\u7684\u504f\u79fb\u503c\uff0c\u5982\u4e0b\u56fe\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u76f8\u5bf9\u4e8e\u6587\u6863\u7684\u504f\u79fb\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_214150.png\" title=\"\u76f8\u5bf9\u4e8e\u6587\u6863\u7684\u504f\u79fb\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"272\" height=\"179\" \/><\/p>\n<p>\u5f53\u70b9\u51fb\u4e0b\u9762\u7684\u6309\u94ae\u8ba9\u6309\u94ae\u7236\u6807\u7b7e<code>position<\/code>\u4e3a<code>relative<\/code>\uff0c\u6b64\u65f6\u518d\u70b9\u51fb\u4e0a\u9762\u8ba1\u7b97\u504f\u79fb\u7684\u6309\u94ae\uff0c\u5219\u7ed3\u679c\u5c31\u662f10\u4e86\uff0c\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u7236\u6807\u7b7e\u53d8\u6210\u5b9a\u4f4d\u5143\u7d20\u540e\u6309\u94ae\u7684\u504f\u79fb\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_225807.png\" title=\"\u7236\u6807\u7b7e\u53d8\u6210\u5b9a\u4f4d\u5143\u7d20\u540e\u6309\u94ae\u7684\u504f\u79fb\u503c \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"326\" height=\"260\" \/><\/p>\n<p>\u8fd9\u4e2a\u5c5e\u6027\u53ef\u4ee5\u8bf4\u662f\u76f8\u5f53\u667a\u80fd\u4e0efunny\uff0c\u6211\u8111\u4e2d\u5f00\u59cb\u60f3\u5230\u5982\u4f55\u8ba9\u4e00\u4e9b\u4ea4\u4e92\u7684\u5b9e\u73b0\u66f4\u4ece\u5bb9\u4e86\uff01<\/p>\n<p><strong>4. offsetParent<\/strong><br \/>\n\u7b2c\u4e00\u4e2a\u7956\u5b9a\u4f4d\u5143\u7d20\uff08\u5373\u7528\u6765\u8ba1\u7b97\u4e0a\u9762\u7684<code>offsetLeft<\/code>\u548c<code>offsetTop<\/code>\u7684\u5143\u7d20\uff09\uff0c\u517c\u5bb9\u6027\u8ba9\u4eba\u6b23\u6170\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">offsetParent<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/offset-parent.html\">offsetParent\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p><code>offsetParent<\/code>\u5143\u7d20\u53ea\u53ef\u80fd\u662f\u4e0b\u9762\u8fd9\u51e0\u79cd\u60c5\u51b5\uff1a<\/p>\n<ul id=\"ul\">\n<li><code>&lt;body&gt;<\/code><\/li>\n<li><code>position<\/code>\u4e0d\u662f<code>static<\/code>\u7684\u5143\u7d20<\/li>\n<li><code>&lt;table&gt;<\/code>, <code>&lt;th&gt;<\/code> \u6216<code>&lt;td&gt;<\/code>\uff0c\u4f46\u5fc5\u987b\u8981<code>position: static<\/code>\u3002<\/li>\n<\/ul>\n<p>\u5728\u672cdemo\u4f8b\u5b50\u4e2d\uff0c\u9875\u9762\u662f\u6ca1\u6709\u4efb\u4f55\u5b9a\u4f4d\u5143\u7d20\uff0c\u4e8e\u662f\uff0c\u70b9\u51fb\u6309\u94ae\u540e\u8fd4\u56de\u7684\u5c31\u662f<code>body<\/code>\u6807\u7b7e\u4e86\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u8fd4\u56de\u5b9a\u4f4d\u5143\u7d20\u7ec8\u6781boss body\u6807\u7b7e \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_230834.png\" title=\"\u8fd4\u56de\u5b9a\u4f4d\u5143\u7d20\u7ec8\u6781boss body\u6807\u7b7e \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"282\" height=\"182\" \/><\/p>\n<p><code>body<\/code>\u5143\u7d20\u4e3a\u5b9a\u4f4d\u5143\u7d20\u7684\u7ec8\u6781boss\uff0c\u6240\u4ee5\u5176\u4e0a\u5934\u5c31\u6ca1\u6709\u5176\u4ed6\u5b9a\u4f4d\u5143\u7d20\u4e86\u3002\u4e5f\u5c31\u662f\u8bf4<code>body<\/code>\u5143\u7d20\u6ca1\u6709<code>offsetParent<\/code>\uff08\u5c3d\u7ba1\u6709\u65f6\u5019<code>html<\/code>\u8fdb\u5165<code>offsetParent<\/code>\u94fe\uff09\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5728IE\u548cOpera\u6d4f\u89c8\u5668\u4e0b\uff0c<code>position: fixed<\/code>\u7684\u5143\u7d20\u6ca1\u6709<code>offsetParent<\/code>\u3002<\/p>\n<p><strong>5. offsetWidth\u548coffsetHeight<\/strong><br \/>\n\u6574\u4e2a\u5143\u7d20\u7684\u5c3a\u5bf8\uff08\u5305\u62ec\u8fb9\u6846\uff09\u3002\u517c\u5bb9\u6027\u4e0e\u4e0a\u9762\u4e00\u81f4\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">offsetWidth\u548coffsetHeight<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/offsetwidth-offsetheight.html\">offsetWidth\/offsetHeight\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u5bf9\u6bd4\u524d\u9762<a href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/clientwidth-clientheight.html\">clientWidth\u548cclientHeight\u6d4b\u8bd5\u9875\u9762<\/a>\u7684\u6309\u94ae\u9ad8\u5ea6\u503c\uff0c\u4f8b\u5982IE9\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"IE9\u4e0b\u6309\u94ae\u7684offsetHeight\u503c\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-08_232444.png\" title=\"IE9\u4e0b\u6309\u94ae\u7684offsetHeight\u503c\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"250\" height=\"221\" \/><\/p>\n<p>\u53ef\u4ee5\u53d1\u73b0\u9ad8\u5ea6\u503c\u591a\u4e86<code>6<\/code>\u50cf\u7d20\uff0c\u8fd9\u6b63\u597d\u662f\u4e0a\u4e0b<code>3<\/code>\u50cf\u7d20\u8fb9\u6846\u7684\u9ad8\u5ea6\u503c\u3002<\/p>\n<p><strong>6. scrollLeft\u548cscrollTop<\/strong><br \/>\n\u8868\u793a\u5143\u7d20\u6eda\u52a8\u7684\u50cf\u7d20\u5927\u5c0f\u3002\u53ef\u8bfb\u53ef\u5199\u3002\u8fd9\u4e2a\u73a9\u610f\u8c8c\u4f3c\u6211\u4eec\u7528\u5f97\u6bd4\u8f83\u591a\u3002\u517c\u5bb9\u6027\u8fd8\u662f\u53ef\u4ee5\u7684\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">scrollLeft\u548cscrollTop<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u7b80\u5355\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>element.scrollLeft\nelement.scrollTop\nelement.scrollTop = 20<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/scrolltop.html\">scrollTop\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u70b9\u51fb\u6309\u94ae\u540e\u9875\u9762\u6eda\u52a8\u9ad8\u5ea6100\u50cf\u7d20\uff0c\u76f8\u5173\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>document.getElementsByTagName(\"body\")[0].scrollTop = 100;\ndocument.getElementsByTagName(\"html\")[0].scrollTop = 100;<\/pre>\n<\/div>\n<p><strong>6.scrollWidth\u548cscrollHeight<\/strong><br \/>\n\u8868\u793a\u6574\u4e2a\u5185\u5bb9\u533a\u57df\u7684\u5bbd\u9ad8\uff0c\u5305\u62ec\u9690\u85cf\u7684\u90e8\u5206\u3002\u5982\u679c\u5143\u7d20\u6ca1\u6709\u9690\u85cf\u7684\u90e8\u5206\uff0c\u5219\u76f8\u5173\u7684\u503c\u5e94\u8be5\u7b49\u7528\u4e8e<code>clientWidth<\/code>\u548c<code>clientHeight<\/code>\u3002\u5f53\u4f60\u5411\u4e0b\u6eda\u52a8\u6eda\u52a8\u6761\u7684\u65f6\u5019\uff0c<code>scrollHeight<\/code>\u5e94\u8be5\u7b49\u7528\u4e8e<code>scrollTop + clientHeight<\/code>\u3002<\/p>\n<p>\u517c\u5bb9\u6027\u6709\u4e9b\u5fae\u5999\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">scrollWidth\u548cscrollHeight<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"3\" class=\"comp incorrect\" title=\"IE 5.5; IE 6; IE 7;\">\u4e0d\u6b63\u786e<\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp incorrect\" title=\"Opera 10.10; Opera 10.53;\">\u4e0d\u6b63\u786e<\/td>\n<td colspan=\"1\" class=\"comp almost\" title=\"Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/part.gif\" class=\"vimg\" \/> \u90e8\u5206<\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/scrollwidth-scrollheight.html\">scrollWidth\/scrollHeight\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u4e0a\u9762\u517c\u5bb9\u6027\u8868\u4e2d\u663e\u793aIE6~IE7\u4e0b\u6b64\u5c5e\u6027\u662f\u4e0d\u51c6\u786e\u7684\u3002\u4ec0\u4e48\u65f6\u5019IE6\/IE7\u6d4f\u89c8\u5668\u4f1a\u62bd\u98ce\u5462\uff1f\u5c31\u662f\u5f53\u5143\u7d20\u6ca1\u6709\u8bbe\u7f6eoverflow\u5c5e\u6027\uff0c\u4f46\u662f\u91cc\u9762\u7684\u5185\u5bb9\u8d85\u8fc7\u5916\u90e8\u9ad8\u5bbd\u7684\u60c5\u51b5\uff0c\u4f8b\u5982\u5c06demo\u9875\u9762\u4e2d\u7c7b\u540d\u4e3a<code>box<\/code>\u7684CSS\u6837\u5f0f\u4e2d\u7684<code>overflow:auto<\/code>\u53bb\u6389\uff0c\u5219FireFox\uff0cIE9\uff0c\u6216\u662fOpera\u6d4f\u89c8\u5668\u8fd4\u56de\u7684\u90fd\u662f<code>200, 180<\/code>\uff0c\u4f46\u662fIE7\u6d4f\u89c8\u5668\u8fd4\u56de\u7684\u5374\u662f\u91cc\u9762\u56fe\u7247\u5143\u7d20\u7684\u5c3a\u5bf8\uff0c\u4e3a<code>256, 191<\/code>\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6211\u5728\u6211\u7684Opera 11.51\u4e0b\u6d4b\u8bd5\uff0c\u6ca1\u6709\u53d1\u73b0\u5173\u4e8e\u8be5\u5c5e\u6027\u7684\u5f02\u5e38\u4e4b\u5904\uff0c\u53ef\u80fdOpera 11.5\u5df2\u7ecf\u5bf9\u8be5\u5c5e\u6027\u5f88\u597d\u652f\u6301\u4e86\u3002<\/p>\n<h3>\u4e94\u3001\u9f20\u6807\u4f4d\u7f6e(Mouse position)<\/h3>\n<p>\u4e0e\u9f20\u6807\u4e8b\u4ef6\uff08\u4f8b\u5982\u666e\u901a\u7684\u5355\u51fb\uff09\u76f8\u5173\u7684\u4e9b\u5c5e\u6027\u3002\u8fd9\u4e2a\u4e1c\u897f\u57fa\u672c\u4e0aJavaScript\u4e00\u4e9b\u5fc5\u4fee\u4e66\u7c4d\uff08\u4f8b\u5982\u300aJavaScript\u9ad8\u7ea7\u7a0b\u5e8f\u8bbe\u8ba1\u300b\uff09\u4e0a\u90fd\u6709\u4ecb\u7ecd\u3002\u8fd9\u91cc\u6211\u5c31\u7b80\u5355\u5c55\u793a\u4e0b\u517c\u5bb9\u6027\u548c\u4e00\u4e9b\u5fc5\u8981\u7684\u6587\u5b57\u4ecb\u7ecd\u3002<br \/>\n\u76f8\u5173\u7684\u4e9b\u5c5e\u6027\u6709\uff1a<br \/>\n<code>clientX,clientY<\/code><br \/>\n<code>offsetX, offsetY<\/code><br \/>\n<code>pageX, pageY<\/code><br \/>\n<code>screenX, screenY<\/code><br \/>\n<code>x, y<\/code><\/p>\n<p><strong>1. clientX,clientY<\/strong><br \/>\n\u76f8\u5bf9\u4e8ewindow\uff0c\u4e3a\u9f20\u6807\u76f8\u5bf9\u4e8ewindow\u7684\u504f\u79fb\u3002\u5728iphone\u4e0a\uff0c\u8fd9\u5bf9\u503c\u8fd4\u56de\u7684\u4f4d\u7f6e\u5c31\u7b49\u540c\u4e8e\u4e0b\u9762\u8981\u63d0\u5230\u7684<code>pageX\/Y<\/code>\u3002\u517c\u5bb9\u6027\u4e0d\u8d56\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">clientX,clientY<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u7b80\u5355\u4f7f\u7528\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>event.clientX\nevent.clientY<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/clientx-clienty.html\">clientX\/clientY\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u53ef\u4ee5\u53d1\u73b0\uff0c\u70b9\u5728\u6309\u94ae\u7684\u4f4d\u7f6e\u4e0d\u540c\uff0c\u5f39\u51fa\u7684\u503c\u4e5f\u4e0d\u4e00\u6837\uff0c\u56e0\u4e3a\u504f\u79fb\u5927\u5c0f\u662f\u9f20\u6807\u76f8\u5bf9\u4e8ewindow\u7a97\u53e3\u7684\u5927\u5c0f\u3002<\/p>\n<p><strong>2. offsetX, offsetY<\/strong><br \/>\n\u8868\u793a\u9f20\u6807\u76f8\u5bf9\u4e8e\u5f53\u524d\u88ab\u70b9\u51fb\u5143\u7d20<code>padding box<\/code>\u7684\u5de6\u4e0a\u504f\u79fb\u503c\uff0c\u5404\u4e2a\u6d4f\u89c8\u5668\u7684\u517c\u5bb9\u6027\u4e94\u82b1\u516b\u95e8\uff0c\u5982\u4e0b\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">offsetX, offsetY<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"3\" class=\"comp buggy\" title=\"IE 5.5; IE 6; IE 7\">\u6709bug<\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp no\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp incorrect\" title=\"Saf 4.0 Win; Saf 5.0 Win\">border box<\/td>\n<td colspan=\"2\" class=\"comp incorrect\" title=\"Chrome 4; Chrome 5\">border box<\/td>\n<td colspan=\"3\" class=\"comp incorrect\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\">content box<\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u7b80\u5355\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>event.offsetX\nevent.offsetY<\/pre>\n<\/div>\n<p>\u5728IE7\u4ee5\u53ca\u4ee5\u4e0b\u6d4f\u89c8\u5668\u4e0b\uff0c\u53ea\u6709\u5f53\u5f53\u524d\u76ee\u6807\u5143\u7d20\u4e3a<code>offsetParent<\/code>\u662f\u624d\u8ba1\u7b97\u5750\u6807\u503c\uff0c\u5426\u5219\uff0c\u5b83\u5c31\u4f1a\u62ff\u5f53\u524d\u76ee\u6807\u5143\u7d20\u7684<code>offsetParent<\/code>\u6765\u8ba1\u7b97\u3002\u8fd8\u6709\uff0c\u5f53\u53d1\u73b0\u5143\u7d20\u5e94\u7528\u4e86<code>position: relative<\/code>\u540e\uff0cIE\u4f1a\u53bb\u5bfb\u627e\u4e0b\u4e00\u4e2a<code>offsetParent<\/code>\u6765\u8ba1\u7b97<code>offsetY<\/code>\uff0c\u4f46\u53c8\u4e0d\u662f<code>offsetX<\/code>\u3002\u662f\u7684\uff0c\u8bfb\u4e24\u6b21\uff0c\u5f88\u86cb\u75bc\u5427\uff01<\/p>\n<p><strong>3. pageX, pageY<\/strong><br \/>\n\u4e3a\u9f20\u6807\u76f8\u5bf9\u4e8edocument\u7684\u5750\u6807\u3002IE6~IE8\u6d4f\u89c8\u5668\u662f\u4e0d\u652f\u6301\u7684\u3002\u5982\u4e0b\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">pageX, pageY<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"4\" class=\"comp no\" title=\"IE 5.5; IE 6; IE 7; IE8\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td class=\"comp yes\" title=\"IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5; FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u7b80\u5355\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>event.pageX\nevent.pageY<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/pagex-pagey.html\">pageX\/pageY\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u5bf9\u4e8e\u652f\u6301\u7684\u6d4f\u89c8\u5668\uff0c\u8fd4\u56de\u7684\u5c31\u662f\u7531\u9f20\u6807\u70b9\u51fb\u4f4d\u7f6e\u51b3\u5b9a\u7684\u6570\u503c\uff0c\u5bf9\u4e8e\u4e0d\u652f\u6301\u7684\u6d4f\u89c8\u5668\uff0c\u4f8b\u5982IE8\uff0c\u5f97\u5230\u7684\u5c31\u662f<code>undefined<\/code>\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u8fd4\u56depageX\/pageY\u4e3aundefined\u7684\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-09_004434.png\" title=\"\u8fd4\u56depageX\/pageY\u4e3aundefined\u7684\u622a\u56fe \u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b\" class=\"alignnone\" width=\"261\" height=\"221\" \/><\/p>\n<p><strong>4. screenX, screenY<\/strong><br \/>\n\u9f20\u6807\u76f8\u5bf9\u4e8e\u663e\u793a\u5668\u5c4f\u5e55\u7684\u504f\u79fb\u5750\u6807\u3002\u4e45\u8fdd\u7684\u517c\u5bb9\u6027\u8fc7\u5f97\u53bb\u7684\u5c5e\u6027\uff1a<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">sscreenX, screenY<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.0<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"5\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7; IE8; IE9 pr3\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"4\" class=\"comp yes\" title=\"FF 3.0; FF 3.5, FF 3.6; FF 4b1\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u4f7f\u7528\u7b80\u5355\u793a\u4f8b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>event.screenX\nevent.screenY<\/pre>\n<\/div>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/event-screenx-screeny.html\">screenX\/screenY\u5c5e\u6027\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u5728iphone\u4e2d\uff0c\u8fd9\u4e2a\u5c5e\u6027\u57fa\u672c\u4e0a\u5c31\u7b49\u540c\u4e8epageX\/pageY\uff0c\u5c3d\u7ba1\u901a\u5e38\u4f1a\u67091~2\u50cf\u7d20\u70b9\u5dee\u5f02\u3002\u8c01\u53ebiphone\u7684\u663e\u793a\u5668\u533a\u57df\u8ddfwindow\u533a\u57df\u8ddf\u6587\u6863\u533a\u57df\u90fd\u662f\u4e00\u6837\u7684\u5462\uff1f<\/p>\n<p><strong>5. x, y<\/strong><br \/>\n\u76f8\u5f53\u4e8e<code>clientX\/clientY<\/code>\u3002\u65e2\u7136\u5df2\u7ecf\u6709\u4e86<code>clientX\/clientY<\/code>\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u9700\u8981<code>x, y<\/code>\u5462\uff1f\u83ab\u975e\u662f\u4e3a\u4e86\u5c11\u5199\u51e0\u4e2a\u5b57\u6bcd\uff1f\u8c01\u77e5\u9053\u5462\uff01<\/p>\n<h3 style=\"text-align:center; margin:1.5em 0 0.5em; font-size:12px;\">x, y<\/h3>\n<table cellspacing=\"1\" class=\"params_table\" width=\"100%\">\n<tr>\n<th>IE 5.5<\/th>\n<th>IE 6<\/th>\n<th>IE 7<\/th>\n<th>IE8<\/th>\n<th>IE9 pr3<\/th>\n<th>FF 3.5<\/th>\n<th>FF 3.6<\/th>\n<th>FF 4b1<\/th>\n<th>FF 6<\/th>\n<th>Saf 4.0 Win<\/th>\n<th>Saf 5.0 Win<\/th>\n<th>Chrome 4<\/th>\n<th>Chrome 5<\/th>\n<th>Opera 10.10<\/th>\n<th>Opera 10.53<\/th>\n<th>Opera 10.60<\/th>\n<th>Konqueror 4.x<\/th>\n<\/tr>\n<tr>\n<td colspan=\"3\" class=\"comp yes\" title=\"IE 5.5; IE 6; IE 7\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp alternative\" title=\"IE8; IE9 pr3\">page X\/Y<\/td>\n<td colspan=\"4\" class=\"comp no\" title=\"FF 3.5; FF 3.6; FF 4b1; FF 6.0 \"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/error.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Saf 4.0 Win; Saf 5.0 Win\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"2\" class=\"comp yes\" title=\"Chrome 4; Chrome 5\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td colspan=\"3\" class=\"comp yes\" title=\"Opera 10.10; Opera 10.53; Opera 10.60\"><img decoding=\"async\" src=\"http:\/\/www.zhangxinxu.com\/study\/image\/ok.gif\" \/><\/td>\n<td class=\"comp test\" title=\"Konqueror 4.x\">\u5373\u5c06\u6d4b\u8bd5<\/td>\n<\/tr>\n<\/table>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" target=\"_blank\" href=\"http:\/\/www.zhangxinxu.com\/study\/201109\/client-x-y.html\">event.x\u548cevent.y\u6d4b\u8bd5demo<\/a><\/p>\n<p>\u6211\u6d4b\u4e86\u4e0b\uff0c\u5373\u4f7f\u662f\u5728FireFox 6\u4e0b\uff0c\u706b\u72d0\u4f9d\u65e7\u4e0d\u9e1f\u8fd9\u4e2a\u5979\u53ef\u80fd\u89c9\u5f97\u591a\u4f59\u7684\u5c5e\u6027\u3002\u4f8b\u5982\u4e0a\u9762\u7684demo\u70b9\u51fb\u540e\u5f39\u51fa\u7684\u5c31\u662f<code>undefined<\/code>\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"FireFox6\u4e0bevent.x\u548cevent.y\u8fd4\u56de\u7684undefined\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/2011-09-09_010114.png\" title=\"FireFox6\u4e0bevent.x\u548cevent.y\u8fd4\u56de\u7684undefined\" class=\"alignnone\" width=\"272\" height=\"176\" \/><\/p>\n<h3>\u516d\u3001\u7ed3\u675f\u968f\u4fbf\u70b9\u4ec0\u4e48<\/h3>\n<p>\u4e0a\u9762\u9646\u7eed\u51fa\u73b0\u7684\u5c5e\u6027\u6216\u65b9\u6cd5\uff0c\u90a3\u4e9b\u517c\u5bb9\u6027\u4e0d\u9519\u7684\u4e1c\u897f\u6211\u4eec\u53ef\u4ee5\u591a\u591a\u5173\u6ce8\u4e0b\u3002\u5f88\u591a\u7279\u6027\u90fd\u662f\u975e\u5e38\u5b9e\u7528\u7684\u3002\u8fd9\u4e9b\u57fa\u7840\u7684\u4e1c\u897f\u624d\u662f\u6700\u6700\u91cd\u8981\u7684\u3002\u672c\u6587\u7684\u5185\u5bb9\u8f83\u591a\uff0c\u5982\u679c\u60a8\u4e0d\u662f\u5bf9CSSOM\u89c6\u56fe\u6a21\u5f0f\u5f88\u7cbe\u901a\u7684\u8bdd\uff0c\u4e2a\u4eba\u5efa\u8bae\u53ef\u4ee5\u628a\u6d6e\u8e81\u7684\u5fc3\u9759\u4e00\u9759\uff0c\u6bcf\u5929\u770b\u4e2a\u51e0\u4e2a\u5c5e\u6027\u6216\u65b9\u6cd5\uff0c\u628a\u8fd9\u4e9b\u57fa\u7840\u7684\u4e1c\u897f\u638c\u63e1\u7262\u9760\u4e86\u3002\u8fd9\u624d\u662f\u6700\u53d7\u7528\u7684\u3002<\/p>\n<p>\u4e0d\u8fc7\u561b\uff0c\u6211\u4eec\u505a\u6280\u672f\u7684\uff0c\u4e00\u822c\u90fd\u662f\u6bd4\u8f83\u5fd9\u7684\uff0c\u4e0d\u662f\u90fd\u80fd\u62bd\u51fa\u65f6\u95f4\u9605\u8bfb\uff0c\u5b9e\u8df5\u7684\u3002\u6240\u4ee5\u5462\uff0c\u6211\u5c31\u628a\u8fd9\u4e9b\u76f8\u5173\u7684\u90fd\u6574\u7406\u51fa\u6765\u4e86\uff0c\u60a8\u9700\u8981\u7684\u65f6\u5019\u53ef\u4ee5\u50cf\u624b\u518c\u4e00\u6837\u67e5\u4e00\u4e0b\u3002\u8bb0\u4f4f\u672c\u6587\u7684id\u53f7\u662f1907\u3002\u662f\u5317\u4eac\u5965\u8fd0\u4f1a\u7684\u524d101\u5e74\u7684\u516c\u5143\u5e74\u4efd\u3002<\/p>\n<p>\u4e0a\u4e2a\u6708W3C\u51fa\u6765\u7684CSSOM\u89c6\u56fe\u6a21\u5757\u8349\u6848\u867d\u7136\u6709\u4e9b\u7455\u75b5\uff0c\u4f46\u662f\u8fd8\u7b97\u76f8\u5f53\u4f18\u79c0\u7684\u4f5c\u54c1\u3002\u73b0\u5728\u5c31\u5e0c\u671b\u8349\u6848\u53ef\u4ee5\u54cd\u5e94\u4e00\u4e9b\u5efa\u8bae\u53d8\u5f97\u66f4\u5b8c\u5584\u3002\u7136\u540e\u6700\u91cd\u8981\u7684\u5c31\u662f\u6d4f\u89c8\u5668\u751f\u4ea7\u5546\u5bb6\u53ef\u4ee5\u7d27\u8ddf\u89c4\u8303\uff0c\u4fdd\u8bc1\u517c\u5bb9\u6027\u4e0e\u4e00\u81f4\u6027\u3002<\/p>\n<p><strong>\u53c2\u8003\u6587\u7ae0\uff1a<\/strong><br \/>\n1. <a href=\"http:\/\/msdn.microsoft.com\/zh-cn\/ie\/ff468705#_CSSOM_View\">\u9762\u5411\u5f00\u53d1\u4eba\u5458\u7684 Internet Explorer 9 \u6307\u5357<\/a><br \/>\n2. <a href=\"http:\/\/www.quirksmode.org\/blog\/archives\/2008\/02\/the_cssom_view.html\">The CSSOM View Module<\/a><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u81ea<a href=\"http:\/\/www.zhangxinxu.com\/\">\u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<\/a>[<a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a>]<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=1907\" title=\"\u70b9\u51fb\u67e5\u770b\u672c\u6587\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201109\/cssom.jpg\" class=\"imgpad mb10\" width=\"550\" height=\"170\" \/><\/a><br \/>\n\u5c31\u57288\u6708\u4efd\uff0c\u4e5f\u5c31\u662f\u4e0a\u6b21gf\u5927\u59e8\u5988\u6765\u7684\u65f6\u5019\uff0cW3C\u51fa\u7089\u4e86CSSOM\u89c6\u56fe\u6a21\u5757\u8349\u6848\u3002CSSOM\u89c6\u56fe\u6a21\u5757(CSSOM View Module)\u5b9a\u4e49\u4e86\u4e00\u4e9b API\uff0cWeb \u5f00\u53d1\u4eba\u5458\u4f7f\u7528\u8fd9\u4e9b API \u53ef\u4ee5\u8fdb\u884c\u68c0\u67e5\uff0c\u4e5f\u53ef\u4ee5\u4ee5\u7f16\u7a0b\u65b9\u5f0f\u66f4\u6539\u6587\u6863\u53ca\u5176\u5185\u5bb9\u7684\u89c6\u89c9\u5c5e\u6027\uff0c\u5305\u62ec\u5e03\u5c40\u6846\u5b9a\u4f4d\u3001\u89c6\u533a\u5bbd\u5ea6\u548c\u5143\u7d20\u6eda\u52a8\u3002<\/p>\n<p> \u672c\u6587\u7684\u5185\u5bb9\u5c31\u662f\u5c06CSSOM\u89c6\u56fe\u6a21\u5757\u76f8\u5173\u7684\u4e00\u4e9b\u5c5e\u6027\uff0c\u65b9\u6cd5\u7b49\u4e00\u4e2a\u4e00\u4e2a\u6574\u7406\u51fa\u6765\uff0c\u5305\u62ec\u517c\u5bb9\u6027\uff0c\u4f7f\u7528\u7b49\u7b49\u3002\u6bcf\u4e2aAPI\u57fa\u672c\u4e0a\u90fd\u63d0\u4f9bdemo\u9875\u9762\u6d4b\u8bd5\uff0c\u4f7f\u7528\u7684\u6e90\u4ee3\u7801\u5c55\u793a\u7b49\u7b49\u3002\u5185\u5bb9\u8f83\u591a\uff0c\u8bf7\u8010\u5fc3\u9605\u8bfb\u3002\u76f8\u4fe1\u672c\u6587\u7684\u5185\u5bb9\u4f1a\u5bf9\u60a8\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\u7684\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[621,620,628,625,626,627,634,635,619,622,623,243,631,629,630,636,637,624,632,633,574,140,96],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/1907"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1907"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/1907\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}