diff options
Diffstat (limited to 'files/ru/orphaned/web/api/element/currentstyle/index.html')
| -rw-r--r-- | files/ru/orphaned/web/api/element/currentstyle/index.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/files/ru/orphaned/web/api/element/currentstyle/index.html b/files/ru/orphaned/web/api/element/currentstyle/index.html new file mode 100644 index 0000000000..f98340d418 --- /dev/null +++ b/files/ru/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()")}} method.</span> Он доступен в старых версиях Microsoft Internet Explorer. Однако, он возвращает единицы, установленные в CSS в то время как <code>window.getComputedStyle()</code>возвращает значения в пикселях.</p> + +<h2 id="Polyfill">Polyfill</h2> + +<div class="note"> +<p>Эта polyfill возвращает значения в пикселях и, скорее всего, будет довольно медленным, так как оно должно называться {{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="Спецификации">Спецификации</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">had a description on MSDN</a>.</p> + +<h2 id="Browser_Compatibility" name="Browser_Compatibility">Совместимость с браузерами</h2> + +<p>{{Compat("api.Element.currentStyle")}}</p> + +<h2 id="Смотрите_также">Смотрите также</h2> + +<ul> + <li>{{DOMxRef("Element.runtimeStyle")}}</li> + <li>{{DOMxRef("window.getComputedStyle()")}}</li> +</ul> + +<div>{{APIRef("DOM")}}</div> |
