aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/htmlelement/transitionend_event/index.md
diff options
context:
space:
mode:
authorjulieng <julien.gattelier@gmail.com>2021-10-02 17:20:24 +0200
committerSphinxKnight <SphinxKnight@users.noreply.github.com>2021-10-02 17:30:20 +0200
commit1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde (patch)
tree30a56efd3eff3a01bd1611e1840fdbbfacf544a4 /files/fr/web/api/htmlelement/transitionend_event/index.md
parentc05efa8d7ae464235cf83d7c0956e42dc6974103 (diff)
downloadtranslated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.gz
translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.bz2
translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.zip
convert content to md
Diffstat (limited to 'files/fr/web/api/htmlelement/transitionend_event/index.md')
-rw-r--r--files/fr/web/api/htmlelement/transitionend_event/index.md199
1 files changed, 79 insertions, 120 deletions
diff --git a/files/fr/web/api/htmlelement/transitionend_event/index.md b/files/fr/web/api/htmlelement/transitionend_event/index.md
index a780a3023b..2ab87e6a9e 100644
--- a/files/fr/web/api/htmlelement/transitionend_event/index.md
+++ b/files/fr/web/api/htmlelement/transitionend_event/index.md
@@ -11,108 +11,80 @@ tags:
translation_of: Web/API/HTMLElement/transitionend_event
original_slug: Web/Events/transitionend
---
-<div>{{APIRef}}</div>
+{{APIRef}}
-<p>L'événement <strong><code>transitionend</code></strong> est déclenché lorsqu'une <a href="/en-US/docs/CSS/Using_CSS_transitions">transition CSS</a> est terminée. Dans le cas où une transition est supprimée avant la fin, par exemple si {{cssxref ("transition-property")}} est supprimé ou {{cssxref ("display")}} est défini sur <code>none</code>, alors l'événement ne pourra pas être généré.</p>
+L'événement **`transitionend`** est déclenché lorsqu'une [transition CSS](/en-US/docs/CSS/Using_CSS_transitions) est terminée. Dans le cas où une transition est supprimée avant la fin, par exemple si {{cssxref ("transition-property")}} est supprimé ou {{cssxref ("display")}} est défini sur `none`, alors l'événement ne pourra pas être généré.
<table class="properties">
- <tbody>
- <tr>
- <th scope="row">Bulles</th>
- <td>Oui</td>
- </tr>
- <tr>
- <th scope="row">Annulable</th>
- <td>Oui</td>
- </tr>
- <tr>
- <th scope="row">Interface</th>
- <td>{{domxref("TransitionEvent")}}</td>
- </tr>
- <tr>
- <th scope="row">Propriété de gestionnaire d'événements</th>
- <td>{{domxref("GlobalEventHandlers/ontransitionend", "ontransitionend")}}</td>
- </tr>
- </tbody>
+ <tbody>
+ <tr>
+ <th scope="row">Bulles</th>
+ <td>Oui</td>
+ </tr>
+ <tr>
+ <th scope="row">Annulable</th>
+ <td>Oui</td>
+ </tr>
+ <tr>
+ <th scope="row">Interface</th>
+ <td>{{domxref("TransitionEvent")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">Propriété de gestionnaire d'événements</th>
+ <td>
+ {{domxref("GlobalEventHandlers/ontransitionend", "ontransitionend")}}
+ </td>
+ </tr>
+ </tbody>
</table>
-<p>L'événement <code>transitionend</code> est déclenché dans les deux sens - à la fin de la transition vers l'état de transition et lorsqu'il revient complètement à l'état par défaut ou sans transition. S'il n'y a pas de délai ou de durée de transition, si les deux sont 0 ou qu'aucun n'est déclaré, il n'y a pas de transition et aucun des événements de transition n'est déclenché.  Si l'événement <code>transitioncancel</code> est déclenché, l'événement <code>transitionend</code> ne se déclenchera pas.</p>
-
-<h2 id="Propriétés">Propriétés</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Propriétés</th>
- <th scope="col">Type</th>
- <th scope="col">Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>target</code> {{readonlyInline}}</td>
- <td>{{domxref("EventTarget")}}</td>
- <td>The event target (the topmost target in the DOM tree).</td>
- </tr>
- <tr>
- <td><code>type</code> {{readonlyInline}}</td>
- <td>{{domxref("DOMString")}}</td>
- <td>The type of event.</td>
- </tr>
- <tr>
- <td><code>bubbles</code> {{readonlyInline}}</td>
- <td>{{jsxref("Boolean")}}</td>
- <td>Whether the event normally bubbles or not.</td>
- </tr>
- <tr>
- <td><code>cancelable</code> {{readonlyInline}}</td>
- <td>{{jsxref("Boolean")}}</td>
- <td>Whether the event is cancellable or not.</td>
- </tr>
- <tr>
- <td><code>propertyName</code> {{readonlyInline}}</td>
- <td>{{domxref("DOMString")}}</td>
- <td>The name of the CSS property associated with the transition.</td>
- </tr>
- <tr>
- <td><code>elapsedTime</code> {{readonlyInline}}</td>
- <td>Float</td>
- <td>The amount of time the transition has been running, in seconds, as of the time the event was generated. This value is not affected by the value of <code>transition-delay</code>.</td>
- </tr>
- <tr>
- <td><code>pseudoElement</code> {{readonlyInline}}</td>
- <td>{{domxref("DOMString")}}</td>
- <td>The name (beginning with two colons) of the CSS pseudo-element on which the transition occured (in which case the target of the event is that pseudo-element's corresponding element), or the empty string if the transition occurred on an element (which means the target of the event is that element).</td>
- </tr>
- </tbody>
-</table>
+L'événement `transitionend` est déclenché dans les deux sens - à la fin de la transition vers l'état de transition et lorsqu'il revient complètement à l'état par défaut ou sans transition. S'il n'y a pas de délai ou de durée de transition, si les deux sont 0 ou qu'aucun n'est déclaré, il n'y a pas de transition et aucun des événements de transition n'est déclenché.  Si l'événement `transitioncancel` est déclenché, l'événement `transitionend` ne se déclenchera pas.
+
+## Propriétés
+
+| Propriétés | Type | Description |
+| ---------------------------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `target` {{readonlyInline}} | {{domxref("EventTarget")}} | The event target (the topmost target in the DOM tree). |
+| `type` {{readonlyInline}} | {{domxref("DOMString")}} | The type of event. |
+| `bubbles` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event normally bubbles or not. |
+| `cancelable` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event is cancellable or not. |
+| `propertyName` {{readonlyInline}} | {{domxref("DOMString")}} | The name of the CSS property associated with the transition. |
+| `elapsedTime` {{readonlyInline}} | Float | The amount of time the transition has been running, in seconds, as of the time the event was generated. This value is not affected by the value of `transition-delay`. |
+| `pseudoElement` {{readonlyInline}} | {{domxref("DOMString")}} | The name (beginning with two colons) of the CSS pseudo-element on which the transition occured (in which case the target of the event is that pseudo-element's corresponding element), or the empty string if the transition occurred on an element (which means the target of the event is that element). |
-<h2 id="Examples">Examples</h2>
+## Examples
-<p>This code gets an element that has a transition defined and adds a listener to the <code>transitionend</code> event:</p>
+This code gets an element that has a transition defined and adds a listener to the `transitionend` event:
-<pre class="brush: js">const transition = document.querySelector('.transition');
+```js
+const transition = document.querySelector('.transition');
-transition.addEventListener('transitionend', () =&gt; {
+transition.addEventListener('transitionend', () => {
console.log('Transition ended');
-});</pre>
+});
+```
-<p>The same, but using the {{domxref("GlobalEventHandlers/ontransitionend", "ontransitionend")}}:</p>
+The same, but using the {{domxref("GlobalEventHandlers/ontransitionend", "ontransitionend")}}:
-<pre class="brush: js">const transition = document.querySelector('.transition');
+```js
+const transition = document.querySelector('.transition');
-transition.ontransitionend = () =&gt; {
+transition.ontransitionend = () => {
console.log('Transition ended');
-};</pre>
+};
+```
-<h3 id="Live_example">Live example</h3>
+### Live example
-<p>In the following example, we have a simple {{htmlelement("div")}} element, styled with a transition that includes a delay:</p>
+In the following example, we have a simple {{htmlelement("div")}} element, styled with a transition that includes a delay:
-<pre class="brush: html">&lt;div class="transition"&gt;Hover over me&lt;/div&gt;
-&lt;div class="message"&gt;&lt;/div&gt;</pre>
+```html
+<div class="transition">Hover over me</div>
+<div class="message"></div>
+```
-<pre class="brush: css">.transition {
+```css
+.transition {
width: 100px;
height: 100px;
background: rgba(255,0,0,1);
@@ -124,11 +96,13 @@ transition.ontransitionend = () =&gt; {
.transition:hover {
transform: rotate(90deg);
background: rgba(255,0,0,0);
-}</pre>
+}
+```
-<p>To this, we'll add some JavaScript to indicate that the <code><a href="/en-US/docs/Web/API/HTMLElement/transitionstart_event">transitionstart</a></code>, <code><a href="/en-US/docs/Web/API/HTMLElement/transitionrun_event">transitionrun</a></code>, <code><a href="/en-US/docs/Web/API/Window/transitioncancel_event">transitioncancel</a></code> and <code>transitionend</code> events fire. In this example, to cancel the transition, stop hovering over the transitioning box before the transition ends. For the transition end event to fire, stay hovered over the transition until the transition ends.</p>
+To this, we'll add some JavaScript to indicate that the [`transitionstart`](/en-US/docs/Web/API/HTMLElement/transitionstart_event), [`transitionrun`](/en-US/docs/Web/API/HTMLElement/transitionrun_event), [`transitioncancel`](/en-US/docs/Web/API/Window/transitioncancel_event) and `transitionend` events fire. In this example, to cancel the transition, stop hovering over the transitioning box before the transition ends. For the transition end event to fire, stay hovered over the transition until the transition ends.
-<pre class="brush: js">const message = document.querySelector('.message');
+```js
+const message = document.querySelector('.message');
const el = document.querySelector('.transition');
el.addEventListener('transitionrun', function() {
@@ -146,46 +120,31 @@ el.addEventListener('transitioncancel', function() {
el.addEventListener('transitionend', function() {
 message.textContent = 'transitionend fired';
});
-</pre>
+```
-<p>{{ EmbedLiveSample('Live_example', '100%', '150px') }}</p>
+{{ EmbedLiveSample('Live_example', '100%', '150px') }}
-<p>The <code>transitionend</code> event is fired in both directions: when the box finishes turning and the opacity hits 0 or 1, depending on the direction.</p>
+The `transitionend` event is fired in both directions: when the box finishes turning and the opacity hits 0 or 1, depending on the direction.
-<p>If there is no transition delay or duration, if both are 0s or neither is declared, there is no transition, and none of the transition events are fired.</p>
+If there is no transition delay or duration, if both are 0s or neither is declared, there is no transition, and none of the transition events are fired.
-<p>If the <code>transitioncancel</code> event is fired, the <code>transitionend</code> event will not fire.</p>
+If the `transitioncancel` event is fired, the `transitionend` event will not fire.
-<h2 id="Spécifications">Spécifications</h2>
+## Spécifications
-<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("CSS3 Transitions", "#transitionend", "transitionend")}}</td>
- <td>{{Spec2('CSS3 Transitions')}}</td>
- <td>Définition initiale.</td>
- </tr>
- </tbody>
-</table>
+| Spécification | Statut | Commentaire |
+| ---------------------------------------------------------------------------------------- | ---------------------------------------- | -------------------- |
+| {{SpecName("CSS3 Transitions", "#transitionend", "transitionend")}} | {{Spec2('CSS3 Transitions')}} | Définition initiale. |
-<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+## Compatibilité des navigateurs
-<p>{{Compat("api.HTMLElement.transitionend_event")}}</p>
+{{Compat("api.HTMLElement.transitionend_event")}}
-<h2 id="Voir_également">Voir également</h2>
+## Voir également
-<ul>
- <li>Le gestionnaire d'événements {{domxref("GlobalEventHandlers.ontransitionend")}}</li>
- <li>L'interface {{domxref("TransitionEvent")}}</li>
- <li>Propriétés CSS : {{cssxref("transition")}}, {{cssxref("transition-delay")}}, {{cssxref("transition-duration")}}, {{cssxref("transition-property")}}, {{cssxref("transition-timing-function")}}</li>
- <li>Événements liés: {{domxref("HTMLElement/transitionrun_event", "transitionrun")}}, {{domxref("HTMLElement/transitionstart_event", "transitionstart")}}, {{domxref("HTMLElement/transitioncancel_event", "transitioncancel")}}</li>
- <li>Cet événement sur {{domxref("Document")}} cible : {{domxref("Document/transitionend_event", "transitionend")}}</li>
- <li>Cet événement sur {{domxref("Window")}} cible : {{domxref("Window/transitionend_event", "transitionend")}}</li>
-</ul>
+- Le gestionnaire d'événements {{domxref("GlobalEventHandlers.ontransitionend")}}
+- L'interface {{domxref("TransitionEvent")}}
+- Propriétés CSS : {{cssxref("transition")}}, {{cssxref("transition-delay")}}, {{cssxref("transition-duration")}}, {{cssxref("transition-property")}}, {{cssxref("transition-timing-function")}}
+- Événements liés: {{domxref("HTMLElement/transitionrun_event", "transitionrun")}}, {{domxref("HTMLElement/transitionstart_event", "transitionstart")}}, {{domxref("HTMLElement/transitioncancel_event", "transitioncancel")}}
+- Cet événement sur {{domxref("Document")}} cible : {{domxref("Document/transitionend_event", "transitionend")}}
+- Cet événement sur {{domxref("Window")}} cible : {{domxref("Window/transitionend_event", "transitionend")}}