Ik heb een simpele orientation detect javascript code die checkt in welke orientatie je de iPad houdt, deze werkt wel in safari maar niet in icab.
Los van de oplossing dat ik ook van CSS kan switchen door all and (orientation:portrait) en all and (orientation:landscape), iemand een idee waarom de orientatie javascript checker niet in icab werkt?
Los van de oplossing dat ik ook van CSS kan switchen door all and (orientation:portrait) en all and (orientation:landscape), iemand een idee waarom de orientatie javascript checker niet in icab werkt?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| <button onclick="detectIPadOrientation();">What's my Orientation?</button> <script type="text/javascript"> window.onorientationchange = detectIPadOrientation; function detectIPadOrientation () { if ( orientation == 0 ) { alert ('Portrait Mode, Home Button bottom'); } else if ( orientation == 90 ) { alert ('Landscape Mode, Home Button right'); } else if ( orientation == -90 ) { alert ('Landscape Mode, Home Button left'); } else if ( orientation == 180 ) { alert ('Portrait Mode, Home Button top'); } } </script> |