diff options
| author | MDN <actions@users.noreply.github.com> | 2021-06-08 00:58:25 +0000 |
|---|---|---|
| committer | MDN <actions@users.noreply.github.com> | 2021-06-08 00:58:25 +0000 |
| commit | 5e990a17012ff5ed90ae1559a11bbe4bc74c887a (patch) | |
| tree | cb5001d2192bc027272aca437d6aa42cbe34212b /files/ja/orphaned/web/api/element | |
| parent | 30628708e318da59965b7c8e0d7fec0d47680909 (diff) | |
| download | translated-content-5e990a17012ff5ed90ae1559a11bbe4bc74c887a.tar.gz translated-content-5e990a17012ff5ed90ae1559a11bbe4bc74c887a.tar.bz2 translated-content-5e990a17012ff5ed90ae1559a11bbe4bc74c887a.zip | |
[CRON] sync translated content
Diffstat (limited to 'files/ja/orphaned/web/api/element')
| -rw-r--r-- | files/ja/orphaned/web/api/element/currentstyle/index.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/files/ja/orphaned/web/api/element/currentstyle/index.html b/files/ja/orphaned/web/api/element/currentstyle/index.html new file mode 100644 index 0000000000..5f1cfa645e --- /dev/null +++ b/files/ja/orphaned/web/api/element/currentstyle/index.html @@ -0,0 +1,51 @@ +--- +title: Element.currentStyle +slug: orphaned/Web/API/Element/currentStyle +tags: + - API + - NeedsExample + - Non-standard + - Property +translation_of: Web/API/Element/currentStyle +original_slug: Web/API/Element/currentStyle +--- +<p>{{Non-standard_header}}</p> + +<p class="summary"><span class="seoSummary"><strong><code>Element.currentStyle</code></strong> は独自プロパティで、標準化されている {{DOMxRef("window.getComputedStyle()")}} メソッドに似ているものです。</span>古いバージョンの Microsoft Internet Explorer で使用できます。しかし、 <code>window.getComputedStyle()</code> がピクセル数で値を返すのに対し、これは CSS で設定された単位で返します。</p> + +<h2 id="Polyfill">ポリフィル</h2> + +<div class="note"> +<p>このポリフィルは値をピクセル数で返しますが、値を読むたびに {{domxref("window.getComputedStyle()")}} を呼び出さなければならないため、かなり遅くなると思われます。</p> +</div> + +<pre class="brush: js">/* すべての著作権をパブリックドメインに寄贈します。 + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +if (!("currentStyle" in Element.prototype)) { + Object.defineProperty(Element.prototype, "currentStyle", { + get: function() { + return window.getComputedStyle(this); + } + }); +} +</pre> + +<h2 id="Specifications">仕様書</h2> + +<p>どの仕様書にも含まれていません。</p> + +<p>Microsoft は <a href="https://web.archive.org/web/20150629144515/https://msdn.microsoft.com/en-us/library/ms535231(v=vs.85).aspx">MSDN で説明しています</a>。</p> + +<h2 id="Browser_compatibility">ブラウザーの互換性</h2> + +<p>{{Compat("api.Element.currentStyle")}}</p> + +<h2 id="See_also">関連情報</h2> + +<ul> + <li>{{DOMxRef("Element.runtimeStyle")}}</li> + <li>{{DOMxRef("window.getComputedStyle()")}}</li> +</ul> + +<div>{{APIRef("DOM")}}</div> |
