aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/clearinterval/index.md
diff options
context:
space:
mode:
authorjulieng <julien.gattelier@gmail.com>2021-10-02 17:20:14 +0200
committerSphinxKnight <SphinxKnight@users.noreply.github.com>2021-10-02 17:30:20 +0200
commitc05efa8d7ae464235cf83d7c0956e42dc6974103 (patch)
tree6ea911b2f2010f63a026de6bb7a1a51e7690a7e1 /files/fr/web/api/clearinterval/index.md
parent13a5e017558b248ee1647d4a5825f183b51f09ad (diff)
downloadtranslated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.tar.gz
translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.tar.bz2
translated-content-c05efa8d7ae464235cf83d7c0956e42dc6974103.zip
move *.html to *.md
Diffstat (limited to 'files/fr/web/api/clearinterval/index.md')
-rw-r--r--files/fr/web/api/clearinterval/index.md72
1 files changed, 72 insertions, 0 deletions
diff --git a/files/fr/web/api/clearinterval/index.md b/files/fr/web/api/clearinterval/index.md
new file mode 100644
index 0000000000..a6dbfe8cb4
--- /dev/null
+++ b/files/fr/web/api/clearinterval/index.md
@@ -0,0 +1,72 @@
+---
+title: WindowOrWorkerGlobalScope.clearInterval()
+slug: Web/API/clearInterval
+tags:
+ - API
+ - Méthode
+ - Reference
+ - WindowOrWorkerGlobalScope
+ - clearInterval
+translation_of: Web/API/WindowOrWorkerGlobalScope/clearInterval
+original_slug: Web/API/WindowOrWorkerGlobalScope/clearInterval
+---
+<div>{{APIRef("HTML DOM")}}</div>
+
+<p>La méthode <strong><code>clearInterval()</code></strong>, rattachée au <em>mixin </em>{{domxref("WindowOrWorkerGlobalScope")}}, permet d'annuler une action répétée minutée initiée via un appel à {{domxref("WindowOrWorkerGlobalScope.setInterval", "setInterval()")}}.</p>
+
+<h2 id="Syntax">Syntaxe</h2>
+
+<pre class="syntaxbox"><em>scope</em>.clearInterval(<var>intervalID</var>)
+</pre>
+
+<h3 id="Paramètres">Paramètres</h3>
+
+<dl>
+ <dt><code>intervalID</code></dt>
+ <dd>L'identifiant de l'intervalle de répétition qu'on souhaite annuler. Cet identifiant est renvoyé lorsqu'on appelle <code>setInterval()</code> pour définir l'intervalle de répétition.</dd>
+</dl>
+
+<p>On notera que l'ensemble des identifiants utilisés est commun entre ceux fournis par {{domxref("WindowOrWorkerGlobalScope.setInterval", "setInterval()")}} et ceux fournis par {{domxref("WindowOrWorkerGlobalScope.setTimeout", "setTimeout()")}}. Cela signifie qu'on peut, techniquement, utiliser <code>clearInterval()</code> et {{domxref("WindowOrWorkerGlobalScope.clearTimeout", "clearTimeout()")}} de façon interchangeable. C'est toutefois une mauvaise pratique, qui nuit à la lisibilité du code et à sa maintenabilité.</p>
+
+<h3 id="Valeur_de_retour">Valeur de retour</h3>
+
+<p>{{jsxref("undefined")}}</p>
+
+<h2 id="Example">Exemples</h2>
+
+<p>Voir <a href="/fr/docs/Web/API/WindowTimers/setInterval#Exemples">l'exemple <code>setInterval()</code></a>.</p>
+
+<h2 id="Specification">Spécifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">État</th>
+ <th scope="col">Commentaires</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'webappapis.html#dom-clearinterval', 'WindowOrWorkerGlobalScope.clearInterval()')}}</td>
+ <td>{{Spec2("HTML WHATWG")}}</td>
+ <td>Cette méthode a été déplacée sur le <em>mixin</em> <code>WindowOrWorkerGlobalScope</code>.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'webappapis.html#dom-clearinterval', 'clearInterval()')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p>{{Compat("api.WindowOrWorkerGlobalScope.clearInterval")}}</p>
+
+<h2 id="Voir_aussi">Voir aussi</h2>
+
+<ul>
+ <li>{{domxref("WindowOrWorkerGlobalScope.setTimeout")}}</li>
+ <li>{{domxref("WindowOrWorkerGlobalScope.setInterval")}}</li>
+ <li>{{domxref("WindowOrWorkerGlobalScope.clearTimeout")}}</li>
+ <li>{{domxref("Window.requestAnimationFrame")}}</li>
+</ul>