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

fullscreenchange事件当浏览器进入或离开全屏时触发.

+ +

General info

+ +
+
Specification
+
Fullscreen
+
Interface
+
Event
+
Bubbles
+
Yes
+
Cancelable
+
No
+
Target
+
Document
+
Default Action
+
None
+
+ +

Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
target {{readonlyInline}}{{domxref("EventTarget")}}The event target (the topmost target in the DOM tree).
type {{readonlyInline}}{{domxref("DOMString")}}The type of event.
bubbles {{readonlyInline}}{{jsxref("Boolean")}}Whether the event normally bubbles or not.
cancelable {{readonlyInline}}{{jsxref("Boolean")}}Whether the event is cancellable or not.
+ +

Example

+ +
// Note that the API is still vendor-prefixed in browsers implementing it
+document.addEventListener("fullscreenchange", function( event ) {
+
+    // The event object doesn't carry information about the fullscreen state of the browser,
+    // but it is possible to retrieve it through the fullscreen API
+    if ( document.fullscreenElement !== null ) {
+
+        // The target of the event is always the document,
+        // but it is possible to retrieve the fullscreen element through the API
+        document.fullscreenElement;
+    }
+
+});
+ + + + + +

See also

+ + -- cgit v1.2.3-54-g00ecf