javascript - How do I lock the orientation to portrait mode in a Mobile Web Application? -


i making web application using html, , javascript mobile devices (phones). how can lock screen orientation in portrait? there extensions, or frameworks this?

edit: when user goes landscape mode, want div (in shape of box if matters) displayed contains text "please turn device portrait."

you can use following css media query:

@media screen , (orientation: landscape) {    .main-content { display: none; }    .use-portrait { display: block; } } 

which hide main-content , show use-portrait div when device in landscape mode. can use additional css rotate use-portrait div further entice user that:

.use-portrait {   -webkit-transform: rotate(90deg);       transform: rotate(90deg);   } 

and may need translate appear correctly.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -