diff options
Diffstat (limited to 'files/fr/orphaned/web/api/element/currentstyle/index.html')
| -rw-r--r-- | files/fr/orphaned/web/api/element/currentstyle/index.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/files/fr/orphaned/web/api/element/currentstyle/index.html b/files/fr/orphaned/web/api/element/currentstyle/index.html new file mode 100644 index 0000000000..fdc8666731 --- /dev/null +++ b/files/fr/orphaned/web/api/element/currentstyle/index.html @@ -0,0 +1,49 @@ +--- +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 +--- +<div>{{APIRef("DOM")}}{{Non-standard_header}}</div> + +<p class="summary"><strong><code>Element.currentStyle</code></strong> est une propriété propriétaire qui est similaire à la méthode normalisée {{DOMxRef("window.getComputedStyle()")}}. Elle est disponible dans les anciennes versions de Microsoft Internet Explorer. Cependant, elle renvoie les unités définies dans CSS alors que <code>window.getComputedStyle()</code> renvoie les valeurs en pixels.</p> + +<h2 id="Polyfill">Prothèse d'émulation</h2> + +<div class="notecard note"> + <p>Cette prothèse d'émulation retourne les valeurs en pixels et risque d'être plutôt lent, car il doit appeler {{domxref("window.getComputedStyle()")}} chaque fois que sa valeur est lue.</p> +</div> + +<pre class="brush: js">/* Tout droit d'auteur est dédié au domaine public. + * 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">Spécifications</h2> + +<p>Ne fait partie d'aucune spécification.</p> + +<p>Microsoft <a href="https://web.archive.org/web/20150629144515/https://msdn.microsoft.com/en-us/library/ms535231(v=vs.85).aspx">a une description MSDN</a>.</p> + +<h2 id="Browser_compatibility">Compatibilité des navigateurs</h2> + +<p>{{Compat("api.Element.currentStyle")}}</p> + +<h2 id="See_also">Voir aussi</h2> + +<ul> + <li>{{DOMxRef("Element.runtimeStyle")}}</li> + <li>{{DOMxRef("window.getComputedStyle()")}}</li> +</ul> |
