Summary of screen rotation problems

Source: Internet
Author: User

One, vertical screen to horizontal screen problem

<!--UC Force vertical screen--
<meta name= "Screen-orientation" content= "Portrait" >
<!--QQ Forced vertical screen--
<meta name= "X5-orientation" content= "Portrait" >
<!--UC Mandatory fullscreen--
<meta name= "Full-screen" content= "yes" >
<!--QQ Mandatory fullscreen--
<meta name= "X5-fullscreen" content= "true" >
<!--UC Application Mode--
<meta name= "Browsermode" content= "Application" >
<!--QQ Application Mode--
<meta name= "X5-page-mode" content= "App" >
<!--windows Phone Click No Highlight--
<meta name= "Msapplication-tap-highlight" content= "no" >
<!--adapt to mobile end---

Second, monitoring screen rotation

4. Screen Rotation event: Onorientationchange

Add a screen rotation event to listen to the screen rotation status (left, right, or not) at any time. Example:

Determine if the screen is rotated

function Orientationchange () {

Switch (window.orientation) {

Case 0:

Alert ("Portrait mode 0,screen-width:" + Screen.width + "; Screen-height: "+ screen.height);

Break

CASE-90:

Alert ("left-handed -90,screen-width:" + Screen.width + "; Screen-height: "+ screen.height);

Break

Case 90:

Alert ("Right-handed 90,screen-width:" + Screen.width + "; Screen-height: "+ screen.height);

Break

Case 180:

Alert ("Landscape mode 180,screen-width:" + Screen.width + "; Screen-height: "+ screen.height);

Break

};<br>};

Add Event Listener

AddEventListener (' Load ', function () {

Orientationchange ();

Window.onorientationchange = Orientationchange;

});

Summary of screen rotation problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.