From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/fr/web/svg/element/animatemotion/index.html | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 files/fr/web/svg/element/animatemotion/index.html (limited to 'files/fr/web/svg/element/animatemotion') diff --git a/files/fr/web/svg/element/animatemotion/index.html b/files/fr/web/svg/element/animatemotion/index.html new file mode 100644 index 0000000000..40aac45931 --- /dev/null +++ b/files/fr/web/svg/element/animatemotion/index.html @@ -0,0 +1,111 @@ +--- +title: animateMotion +slug: Web/SVG/Element/animateMotion +tags: + - Animation SVG + - Element + - SVG +translation_of: Web/SVG/Element/animateMotion +--- +
{{SVGRef}}
+ +

L'élément <animateMotion> permet d'animer un élément le long d'un chemin donné.

+ +

Contexte d'utilisation

+ +

{{svginfo}}

+ +

Attributs

+ +

Attributs globaux

+ + + +

Attributs spécifiques

+ + + +

Interface DOM

+ +

Cet élément implémente l'interface SVGAnimateMotionElement.

+ +

Exemple

+ +

SVG

+ +
<?xml version="1.0"?>
+<svg width="120" height="120" viewBox="0 0 120 120"
+    xmlns="http://www.w3.org/2000/svg" version="1.1"
+    xmlns:xlink="http://www.w3.org/1999/xlink">
+
+  <!-- Dessine le chemin en gris, avec 2 cercles aux extrémités -->
+  <path d="M10,110 A120,120 -45 0,1 110 10 A120,120 -45 0,1 10,110"
+      stroke="lightgrey" stroke-width="2"
+      fill="none" id="theMotionPath"/>
+  <circle cx="10" cy="110" r="3" fill="lightgrey"  />
+  <circle cx="110" cy="10" r="3" fill="lightgrey"  />
+
+  <!-- Cercle rouge qui sera déplacé le long du chemin. -->
+  <circle cx="" cy="" r="5" fill="red">
+
+    <!-- Définit l'animation -->
+    <animateMotion dur="6s" repeatCount="indefinite">
+      <mpath xlink:href="#theMotionPath"/>
+    </animateMotion>
+  </circle>
+</svg>
+ +

Résultat

+ +

{{EmbedLiveSample("Exemple", 120, 120)}}

+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName("SVG Animations 2", "#AnimateMotionElement", "<animateMotion>")}}{{Spec2("SVG Animations 2")}}Aucun changement
{{SpecName('SVG1.1', 'animate.html#AnimateMotionElement', '<animateMotion>')}}{{Spec2('SVG1.1')}}Définition initiale
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("svg.elements.animateMotion")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf