Veuillez utiliser un téléphone ou une tableau pour tester ce script
- <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
- <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='fr' lang='fr'>
- <head>
- <meta http-equiv='content-type' content='text/html; charset=iso-8859-1'/>
-
-
- <!-- Style CSS -->
-
-
-
- </head>
- <body>
-
-
- <br />
-
-
- <!-- Javascript -->
- <script language='Javascript' type='text/javascript'
- src='orientation-telephone.js'></script>
-
- </body>
- </html>
- function process(event) {
-
- var x = event.accelerationIncludingGravity.x;
- var y = event.accelerationIncludingGravity.y;
- var z = event.accelerationIncludingGravity.z;
-
- document.getElementById('log').innerHTML = "X : " + x + "<br />Y : " + y + "<br />Z : " + z;
-
- }
-
- window.addEventListener("devicemotion", process, true);
null
sont affichées, le matériel ne supporte pas l'API Motion