File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ decodeURIComponent('%E6%98%A5%E8%8A%82')
173
173
174
174
` URL ` 对象是浏览器的原生对象,可以用来构造、解析和编码 URL。一般情况下,通过` window.URL ` 可以拿到这个对象。
175
175
176
- ` <a> ` 元素和` <area> ` 元素都部署了这个接口。这就是说,它们的 DOM 节点对象可以 URL 的实例属性和方法。
176
+ ` <a> ` 元素和` <area> ` 元素都部署了这个接口。这就是说,它们的 DOM 节点对象可以使用 URL 的实例属性和方法。
177
177
178
178
``` javascript
179
179
var a = document .createElement (' a' );
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ if (window.parent !== window.top) {
151
151
152
152
注意,这两个属性的返回值不是整数,而是双精度浮点数。如果页面没有滚动,它们的值就是` 0 ` 。
153
153
154
- 举例来说,如果用户向下拉动了垂直滚动条75像素,那么` window.pageYOffset ` 就是75左右。用户水平向右拉动水平滚动条200像素,` window.pageXOffset ` 就是200左右。
154
+ 举例来说,如果用户向下拉动了垂直滚动条75像素,那么` window.scrollY ` 就是75左右。用户水平向右拉动水平滚动条200像素,` window.scrollX ` 就是200左右。
155
155
156
156
``` javascript
157
157
if (window .scrollY < 75 ) {
@@ -171,7 +171,7 @@ if (window.scrollY < 75) {
171
171
172
172
- ` window.locationbar ` :地址栏对象
173
173
- ` window.menubar ` :菜单栏对象
174
- - ` window.scrollbar ` :窗口的滚动条对象
174
+ - ` window.scrollbars ` :窗口的滚动条对象
175
175
- ` window.toolbar ` :工具栏对象
176
176
- ` window.statusbar ` :状态栏对象
177
177
- ` window.personalbar ` :用户安装的个人工具栏对象
@@ -181,7 +181,7 @@ if (window.scrollY < 75) {
181
181
``` javascript
182
182
window .locationbar .visible
183
183
window .menubar .visible
184
- window .scrollbar .visible
184
+ window .scrollbars .visible
185
185
window .toolbar .visible
186
186
window .statusbar .visible
187
187
window .personalbar .visible
Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ document.body.clientHeight
347
347
348
348
` Element.clientLeft ` 属性等于元素节点左边框(left border)的宽度(单位像素),不包括左侧的` padding ` 和` margin ` 。如果没有设置左边框,或者是行内元素(` display: inline ` ),该属性返回` 0 ` 。该属性总是返回整数值,如果是小数,会四舍五入。
349
349
350
- ` Element.clientTop ` 属性等于网页元素顶部边框的宽度(单位像素),其他特点都与` clientTop ` 相同。
350
+ ` Element.clientTop ` 属性等于网页元素顶部边框的宽度(单位像素),其他特点都与` clientLeft ` 相同。
351
351
352
352
### Element.scrollHeight,Element.scrollWidth
353
353
Original file line number Diff line number Diff line change 2
2
3
3
节点都是单个对象,有时需要一种数据结构,能够容纳多个节点。DOM 提供两种节点集合,用于容纳多个节点:` NodeList ` 和` HTMLCollection ` 。
4
4
5
- 这两种集合都属于接口规范。许多 DOM 属性和方法,返回的结果是` NodeList ` 实例或` HTMLCollection ` 实例。
5
+ 这两种集合都属于接口规范。许多 DOM 属性和方法,返回的结果是` NodeList ` 实例或` HTMLCollection ` 实例。主要区别是, ` NodeList ` 可以包含各种类型的节点, ` HTMLCollection ` 只能包含 HTML 元素节点。
6
6
7
7
## NodeList 接口
8
8
11
11
` NodeList ` 实例是一个类似数组的对象,它的成员是节点对象。通过以下方法可以得到` NodeList ` 实例。
12
12
13
13
- ` Node.childNodes `
14
- - ` document.querySelectorAll() ` 、 ` document.getElementsByTagName() ` 等节点搜索方法
14
+ - ` document.querySelectorAll() ` 等节点搜索方法
15
15
16
16
``` javascript
17
17
document .body .childNodes instanceof NodeList // true
You can’t perform that action at this time.
0 commit comments