aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/element/currentstyle/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ru/web/api/element/currentstyle/index.html')
-rw-r--r--files/ru/web/api/element/currentstyle/index.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/files/ru/web/api/element/currentstyle/index.html b/files/ru/web/api/element/currentstyle/index.html
new file mode 100644
index 0000000000..3df9fd524a
--- /dev/null
+++ b/files/ru/web/api/element/currentstyle/index.html
@@ -0,0 +1,52 @@
+---
+title: Element.currentStyle
+slug: Web/API/Element/currentStyle
+tags:
+ - API
+ - NeedsExample
+ - Non-standard
+ - Property
+translation_of: 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>
+
+<div class="hidden">Таблица совместимости на этой странице составлена из структурированных данных. Если Вы хотите внести свой вклад в данные, пожалуйста, посетите https://github.com/mdn/browser-compat-data и отправьте нам запрос.</div>
+
+<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>