{{Compat("api.Document.hidden")}}
--- title: Document.hidden slug: Web/API/Document/hidden translation_of: Web/API/Document/hidden ---
{{ ApiRef("DOM") }}
Document.hidden
(只读属性)返回布尔值,表示页面是(true)否(false)隐藏。
var string = document.hidden
document.addEventListener("visibilitychange", function() { console.log( document.hidden ); // Modify behavior... });
Specification | Status | Comment |
---|---|---|
{{SpecName('Page Visibility API','#dom-document-hidden', 'Document.hidden')}} | {{Spec2('Page Visibility API')}} | Initial definition. |
{{Compat("api.Document.hidden")}}