From eb64f66009ea608f47f8abdae4924a12490cc39a Mon Sep 17 00:00:00 2001 From: YujiSoftware Date: Sat, 1 May 2021 21:08:38 +0900 Subject: UPDATE: FR - Remove old CompatibilityTable to replace with {{Compat()}} on deviceorientation_event (#716) * UPDATE: FR - Remove old CompatibilityTable to replace with {{Compat()}} on deviceorientation_event * UPDATE: Refresh from en-US Co-authored-by: tristantheb --- .../api/window/deviceorientation_event/index.html | 219 ++++++--------------- 1 file changed, 63 insertions(+), 156 deletions(-) (limited to 'files/fr') diff --git a/files/fr/web/api/window/deviceorientation_event/index.html b/files/fr/web/api/window/deviceorientation_event/index.html index a63532296b..3978ebe617 100644 --- a/files/fr/web/api/window/deviceorientation_event/index.html +++ b/files/fr/web/api/window/deviceorientation_event/index.html @@ -1,177 +1,84 @@ --- -title: deviceorientation +title: 'Window : l''événement deviceorientation' slug: Web/API/Window/deviceorientation_event +tags: + - Device Orientation API + - Sensors + - Window Event + - events translation_of: Web/API/Window/deviceorientation_event original_slug: FUEL/Window/deviceorientation --- -

L'événement deviceorientation est déclenché lorsque de nouvelles données sont disponibles à partir d'un capteur d'orientation à propos de l'orientation actuelle du dispositif par rapport à la trame de coordonnées terrestres. Ces données sont recueillies à partir d'un magnétomètre à l'intérieur de l'appareil. Voir explications sur les données de mouvements et d'orientations pour plus de détails.

- -

Informations générales

- -
-
Spécification
-
DeviceOrientation Event
-
Interface
-
DeviceOrientationEvent
-
Propagation
-
Non
-
Annulable
-
Non
-
Cible
-
DefaultView (window)
-
Action par défaut
-
Aucune
-
- -

Propriétés

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
{{APIRef}}
+ +

L'événement deviceorientation est déclenché lorsque des données sont disponibles, à partir d'un capteur d'orientation, sur l'orientation actuelle de l'appareil par rapport au cadre de coordonnées de la Terre. Ces données sont recueillies à partir d'un magnétomètre à l'intérieur de l'appareil. Voir Données d'orientation et de mouvement expliquées pour plus de détails.

+ +
PropertyTypeDescription
target Lecture seule EventTargetThe event target (the topmost target in the DOM tree).
type Lecture seule DOMStringThe type of event.
bubbles Lecture seule BooleanWhether the event normally bubbles or not
cancelable Lecture seule BooleanWhether the event is cancellable or not?
alpha Lecture seule double (float)The current orientation of the device around the Z axis; that is, how far the device is rotated around a line perpendicular to the device.
beta Lecture seule double (float)The current orientation of the device around the X axis; that is, how far the device is tipped forward or backward.
gamma Lecture seule double (float)The current orientation of the device around the Y axis; that is, how far the device is turned left or right.
absolute Lecture seule booleanThis value is true if the orientation is provided as a difference between the device coordinate frame and the Earth coordinate frame; if the device can't detect the Earth coordinate frame, this value is false.
+ + + + + + + + + + + + + + + + + +
PropagationNon
AnnulableNon
InterfaceDeviceOrientationEvent
Propriété du gestionnaire d'événementswindow.ondeviceorientation
-

Example

+

Exemple

-
if (window.DeviceOrientationEvent) {
-    window.addEventListener("deviceorientation", function(event) {
-        // alpha: rotation around z-axis
-        var rotateDegrees = event.alpha;
-        // gamma: left to right
-        var leftToRight = event.gamma;
-        // beta: front back motion
-        var frontToBack = event.beta;
+
if (window.DeviceOrientationEvent) {
+  window.addEventListener("deviceorientation", function(event) {
+    // alpha : rotation autour de l'axe z
+    var rotateDegrees = event.alpha;
+    // gamma : de gauche à droite
+    var leftToRight = event.gamma;
+    // bêta : mouvement avant-arrière
+    var frontToBack = event.beta;
 
-        handleOrientationEvent(frontToBack, leftToRight, rotateDegrees);
-    }, true);
+    handleOrientationEvent(frontToBack, leftToRight, rotateDegrees);
+  }, true);
 }
 
 var handleOrientationEvent = function(frontToBack, leftToRight, rotateDegrees) {
-    // Faire quelque chose d'étonnant
-};
-
- -

Compatibilités navigateur

- -

Nous convertissons les données de compatibilité dans un format JSON. - Ce tableau de compatibilité utilise encore l'ancien format - car nous n'avons pas encore converti les données qu'il contient. - Vous pouvez nous aider en contribuant !
+ // faire quelque chose d'étonnant +};
-
- - -

+

Spécifications

-
- - - - - - - - - - - - - - - - - - - -
NavigateurChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Support basique7.03.6[1]???
-
- -
- - - - - - - - - - - - - - - - - - - +
NavigateurAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Support basique3.03.6[1]Pas de support124.2
+ + + + + + + + + + + +
SpécificationStatut
{{SpecName("Device Orientation", "#deviceorientation", "l'événement DeviceOrientation")}}{{Spec2("Device Orientation")}}
-
-

[1] Firefox 3.6, 4, et 5 a supporté mozOrientation contre l'événement standard DeviceOrientation.

+

Compatibilité des navigateurs

-

Evénements lilés

- - +

{{Compat("api.Window.deviceorientation_event")}}

-

Voir aussi

+

Voir aussi

-- cgit v1.2.3-54-g00ecf