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
Post a Comment