No diré muchas tonterías, solo te postularé el código
El código específico es el siguiente:
<! Doctype html> <html lang = "en"> <fead> <meta charset = "utf-8"> <title> document </title> </head> <script src = "http://libs.baidu.com/jquery/1.9.0/jquery.js"> </script> <script> Var orientación = 0; function screensorOrorsorOrorsorRourationeS == 0) {document.getElementById ("Change"). Value = "Vertical"; $ ("Body"). CSS ({'Transform': 'Rotate (90Deg)', '-WebKit-Transform': 'Rotate (90Deg)', '-Moz-Transform': 'Rotate (90deg)'});} El SE {document.getElementById ("Change"). Value = "Horizontal"; $ ("Body"). CSS ({'Transform': 'Rotate (0Deg)', '-WebKit-Transform': 'Rotate (0Deg)', '-Moz-Transform': 'Rotate (0Deg)'});} Var innerWidthtmp = window.innerWidth; // hori y el método de escucha de pantalla de pantalla de vertical función de escucha de la función ScreenientationListener () {try {var iw = window.innerwidth; // pantalla de pantalla de la dirección de cambio if (iw! = innerwidthtmp) {if (iw> window.innerHeight) {orientación = 90;} otra {orientación = 0;} Event ScreenientationEvent (); innerwidthtmp = iw;}} catch (e) {alert (e);}; // Interval Se corrigió el evento si la pantalla está girada, predeterminada 500ms setTimeOut ("scisionOrientationListener ()", 500);} // Inicie horizontal y vertical vertical eyuring audiencationListener (); </script> <body ondasad = "ScreenientalationEn id = "cambio" type = "text" value = ""/> </body> </html>El código JS anterior es el código central para implementar la pantalla horizontal en el móvil. El código es simple y fácil de entender. No te he adjunto muchos comentarios. Si no entiende nada, por favor déjame un mensaje. El editor le responderá a tiempo. ¡Muchas gracias por su apoyo al sitio web de Wulin Network!