From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/window/frames/index.html | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 files/zh-cn/web/api/window/frames/index.html (limited to 'files/zh-cn/web/api/window/frames') diff --git a/files/zh-cn/web/api/window/frames/index.html b/files/zh-cn/web/api/window/frames/index.html new file mode 100644 index 0000000000..2d3331b096 --- /dev/null +++ b/files/zh-cn/web/api/window/frames/index.html @@ -0,0 +1,56 @@ +--- +title: Window.frames +slug: Web/API/Window/frames +translation_of: Web/API/Window/frames +--- +

{{ApiRef("Window")}}

+ +

概要

+ +

返回当前窗口,一个类数组对象,列出了当前窗口的所有直接子窗口。

+ +

语法

+ +
frameList = window.frames;
+
+ + + +

实例

+ +
var frames = window.frames; // 或 // var frames = window.parent.frames;
+for (var i = 0; i < frames.length; i++) {
+  // 在这对frames的一个frame做点什么
+  frames[i].document.body.style.background = "red";
+
+}
+
+ +

规范

+ +

{{ DOM0() }}

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG','browsers.html#dom-frames','Window.frames')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', 'browsers.html#dom-frames', 'Window.frames')}}{{Spec2('HTML5 W3C')}} 
-- cgit v1.2.3-54-g00ecf