Je ne dirai pas beaucoup de non-sens, je vous publierai juste du code
Le code spécifique est le suivant:
<! Doctype html> <html lang = "en"> <éad> <meta charset = "utf-8"> <t titre> Document </Title> </ head> <script src = "http://libs.baidu.com/jquery/1.9.0/jquery.js"> </cript> == 0) {document.getElementById ("change"). Value = "vertical"; $ ("body"). Css ({'transform': 'rotate (90deg)', '- webkit-transform': 'rotate (90deg)', '- moz-transform': 'rotate (90deg)'});} el el se {document.getElementById ("change"). value = "horizontal"; $ ("body"). css ({'transform': 'rotate (0deg)', '- webkit-transform': 'rotate (0deg)', '- moz-transform': 'rotate (0deg)'});}} var var innerwidthtmp = window.innerwidth; // hori and vertical event event wenket méthode function ScreenorientationListener () {try {var iw = window.innerwidth; // l'écran de modification de modification du traitement if (iw! = innerwidthtmp) {if (iw> window.innerHeight) {orientation = 90;} else {orientation = 0;} ScreenorientationEvent (); innerWidthTMP = iw;}} catch (e) {alert (e);}; // intervalle fixe événemers vérifie si l'écran est tourné, par défaut 500 ms setTimeout ("screenorientationListener ()", 500);} // start on horizontal et vertical event evere screenorientationListener (); id = "change" type = "text" value = "" /> </ body> </html>Le code JS ci-dessus est le code de base pour implémenter l'écran horizontal sur mobile. Le code est simple et facile à comprendre. Je ne vous ai pas attaché trop de commentaires. Si vous ne comprenez rien, laissez-moi un message. L'éditeur vous répondra à temps. Merci beaucoup pour votre soutien pour le site Web du réseau Wulin!