Vote count:
0
The w3c standard for the deviceorientation event:
The W3C standard describes how the alpha attribute of this event is supposed to change when the device is rotated around its z-axis.
The z-axis points towards you when holding the phone in front of you while you're looking straight at its screen. It is a normal vector of the plane coinciding with the screen.
It seems to me that things work slightly (= annoyingly) different on my windows phone. The alpha attribute changes with rotation around the x-axis as well (in portait mode, that is).
How to repeat:
- Hold up the phone in front of you (in portait mode).
- Make sure gamma is negative, meaning the phone it slightly tilted backwards.
- Now make sure that alpha is approx. zero degrees meaning the phone is centered on its y-axis.
- Tilt the phone slightly to the left, make alpha approx 30 degrees, while making sure gamma stays negative.
- Now turn the phone slightly towards you making gamma positive
Notice how, the moment gamma becomes positive, the alpha value jumps 180 degrees. This is not described in the W3C standard, or did miss something?
-
Another strange thing happens when you go to landscape mode. When tilting the phone around its z-axis in landscape mode, not the alpha attribute, but the beta attribute seems to change?! To make the alpha attribute change in landcape mode, you have to turn the phone around it's (original) x-axis, which, for instance, means turning the top of the phone (which is now on the left side, as you are in landscape mode) away from you.
-
I don't have an android or iOS device at my disposal at this time, but at least the emulator in the Chrome desktop browser behaves completely different (and in agreement with the W3C standard, it seems).
-
I put a simple test script here:
-
Am I doing something wrong / missing something?
Any ideas as how to correct this?
Device orientation in Internet explorer 11, strange behavior
Aucun commentaire:
Enregistrer un commentaire