diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-10-02 17:20:24 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-02 17:30:20 +0200 |
| commit | 1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde (patch) | |
| tree | 30a56efd3eff3a01bd1611e1840fdbbfacf544a4 /files/fr/web/api/performanceelementtiming/naturalheight | |
| parent | c05efa8d7ae464235cf83d7c0956e42dc6974103 (diff) | |
| download | translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.gz translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.bz2 translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.zip | |
convert content to md
Diffstat (limited to 'files/fr/web/api/performanceelementtiming/naturalheight')
| -rw-r--r-- | files/fr/web/api/performanceelementtiming/naturalheight/index.md | 60 |
1 files changed, 26 insertions, 34 deletions
diff --git a/files/fr/web/api/performanceelementtiming/naturalheight/index.md b/files/fr/web/api/performanceelementtiming/naturalheight/index.md index 204efdc562..0fc7a49636 100644 --- a/files/fr/web/api/performanceelementtiming/naturalheight/index.md +++ b/files/fr/web/api/performanceelementtiming/naturalheight/index.md @@ -10,55 +10,47 @@ tags: - PerformanceElementTiming translation_of: Web/API/PerformanceElementTiming/naturalHeight --- -<div>{{APIRef("Element Timing API")}}</div> +{{APIRef("Element Timing API")}} -<p>La propriété en lecture seule <strong><code>naturalHeight</code></strong> de l'interface <a href="/fr/docs/Web/API/PerformanceElementTiming"><code>PerformanceElementTiming</code></a> renvoie la hauteur intrinsèque de l'élément image.</p> +La propriété en lecture seule **`naturalHeight`** de l'interface [`PerformanceElementTiming`](/fr/docs/Web/API/PerformanceElementTiming) renvoie la hauteur intrinsèque de l'élément image. -<h2 id="Syntax">Syntaxe</h2> +## Syntaxe -<pre class="brush:js">var <var>height</var> = PerformanceElementTiming.naturalHeight;</pre> +```js +var height = PerformanceElementTiming.naturalHeight; +``` -<h3>Valeur</h3> -<p>Un entier de 32 bits non signé (<i>unsigned long</i>) qui est la hauteur intrinsèque de l'image si cela est appliqué à une image, 0 pour le texte.</p> +### Valeur -<h2 id="Examples">Exemples</h2> +Un entier de 32 bits non signé (_unsigned long_) qui est la hauteur intrinsèque de l'image si cela est appliqué à une image, 0 pour le texte. -<p>Dans cet exemple, le fichier image a une largeur de 1000px et une hauteur de 750px. L'appel de <code>entry.naturalHeight</code> renvoie <code>750</code>, c'est-à-dire la hauteur intrinsèque en pixels.</p> +## Exemples -<pre class="brush:html"><img src="image.jpg" alt="une belle image" elementtiming="big-image" id="myImage"></pre> +Dans cet exemple, le fichier image a une largeur de 1000px et une hauteur de 750px. L'appel de `entry.naturalHeight` renvoie `750`, c'est-à-dire la hauteur intrinsèque en pixels. -<pre class="brush:js">const <var>observer</var> = new PerformanceObserver((list) => { - let <var>entries</var> = list.getEntries().forEach(function (entry) { +```html +<img src="image.jpg" alt="une belle image" elementtiming="big-image" id="myImage"> +``` + +```js +const observer = new PerformanceObserver((list) => { + let entries = list.getEntries().forEach(function (entry) { if (entry.identifier === "big-image") { console.log(entry.naturalHeight); } }); }); -observer.observe({ entryTypes: ["element"] });</pre> +observer.observe({ entryTypes: ["element"] }); +``` -<div class="note"> - <p><strong>Note :</strong> Cet exemple utilise l'interface <a href="/fr/docs/Web/API/PerformanceObserver"><code>PerformanceObserver</code></a> pour créer une liste d'événements de mesure des performances. Dans notre cas, nous observons l'élément <a href="/fr/docs/Web/API/PerformanceEntry/entryType"><code>PerformanceEntry.entryType</code></a> afin d'utiliser l'interface <code>PerformanceElementTiming</code>.</p> -</div> +> **Note :** Cet exemple utilise l'interface [`PerformanceObserver`](/fr/docs/Web/API/PerformanceObserver) pour créer une liste d'événements de mesure des performances. Dans notre cas, nous observons l'élément [`PerformanceEntry.entryType`](/fr/docs/Web/API/PerformanceEntry/entryType) afin d'utiliser l'interface `PerformanceElementTiming`. -<h2 id="Specifications">Specifications</h2> +## Specifications -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Spécification</th> - <th scope="col">Statut</th> - <th scope="col">Commentaire</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('Element Timing API','#dom-performanceelementtiming-naturalheight','PerformanceElementTiming.naturalHeight')}}</td> - <td>{{Spec2('Element Timing API')}}</td> - <td>Initial definition.</td> - </tr> - </tbody> -</table> +| Spécification | Statut | Commentaire | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ------------------- | +| {{SpecName('Element Timing API','#dom-performanceelementtiming-naturalheight','PerformanceElementTiming.naturalHeight')}} | {{Spec2('Element Timing API')}} | Initial definition. | -<h2 id="Browser_compatibility">Compatibilité des navigateurs</h2> +## Compatibilité des navigateurs -<p>{{Compat("api.PerformanceElementTiming.naturalHeight")}}</p> +{{Compat("api.PerformanceElementTiming.naturalHeight")}} |
