📜 ⬆️ ⬇️

Web applications: react to the slopes of the iphone

Many are afraid to write applications for iphone, for fear of difficulties. In fact, there is nothing complicated about it.
Today I will touch on the topic of how your website responds to the slopes of the device.
Let's take a look at the code, which is plain javascript:
// ,
function updateOrientation()
{
var orientation=window.orientation;
switch(orientation)
{
case 0:
alert(" ");
case 90:
alert(" ");
case -90:
alert(" ");
}
}

window.onorientationchange=updateOrientation; //

Do you still think that there is something complicated about it? Welcome to Apple Developer Center
UPDATE: if someone is interested - I will tell you a little more about interesting, but a bit more tedious things. About the screen resolution, how to make your application was of normal size and not have to be brought closer, the principles of the interface, etc.

')

Source: https://habr.com/ru/post/39152/


All Articles