diff options
Diffstat (limited to 'files/zh-cn/web/api/document/laststylesheetset/index.html')
| -rw-r--r-- | files/zh-cn/web/api/document/laststylesheetset/index.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/document/laststylesheetset/index.html b/files/zh-cn/web/api/document/laststylesheetset/index.html new file mode 100644 index 0000000000..e1b83bb840 --- /dev/null +++ b/files/zh-cn/web/api/document/laststylesheetset/index.html @@ -0,0 +1,51 @@ +--- +title: Document.lastStyleSheetSet +slug: Web/API/Document/lastStyleSheetSet +tags: + - API + - CSSOM + - DOM + - 层叠样式表 + - 引用 + - 文档 +translation_of: Web/API/Document/lastStyleSheetSet +--- +<div>{{APIRef("DOM")}}{{gecko_minversion_header("1.9")}}{{obsolete_header}}</div> + +<p><strong><code>Document.lastStyleSheetSet</code></strong> 返回最后一个启用的样式表集合。当 {{domxref("document.selectedStyleSheetSet")}} 属性发生变化时,这个属性的值就会随之发生变化。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox notranslate">var <var>lastStyleSheetSet</var> = <var>document</var>.lastStyleSheetSet +</pre> + +<p>返回时, <var>lastStyleSheetSet</var> 指示最近设置的样式表。 如果当前样式表集尚未通过设置更改 {{domxref("document.selectedStyleSheetSet")}}, 则返回值为 <code>null</code>。</p> + +<div class="note"><strong>注意:</strong> 当{{domxref("document.enableStyleSheetsForSet()")}} 被执行时,该值不会该变。</div> + +<h2 id="示例">示例</h2> + +<pre class="brush: js notranslate">let lastSheetSet = document.lastStyleSheetSet; + +if (!lastSheetSet) { + lastSheetSet = 'Style sheet not yet changed'; +} +else { + console.log('The last style sheet set is: ' + lastSheetSet); +} +</pre> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<div class="hidden">此页面上的兼容性表单是根据结构化数据自动生成的。 如果您想提供其他数据,请查看 <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> 并向我们发送请求。</div> + +<p>{{Compat("api.Document.lastStyleSheetSet")}}</p> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{domxref("document.preferredStyleSheetSet")}}</li> + <li>{{domxref("document.selectedStyleSheetSet")}}</li> + <li>{{domxref("document.styleSheetSets")}}</li> + <li>{{domxref("document.enableStyleSheetsForSet()")}}</li> +</ul> |
