0

I am making an webinterface for some device. But this interface is just supported landscape. Is it possible to set this fixed. Because when i turn it on my tablet it is just crap.

I am using for development Angular JS. I thought maybe with some viewport meta tag but im not sure

NoiZeR
  • 135
  • 2
  • 11
  • possible duplicate of [Blocking device rotation on mobile web pages](http://stackoverflow.com/questions/3501510/blocking-device-rotation-on-mobile-web-pages) – Artem Petrosian May 04 '15 at 11:36

1 Answers1

0

As from this post, you can use orientationlock plugin to achieve this.

From your JavaScript code call 

window.plugins.orientationLock.unlock()

 to unlock orientation, 

window.plugins.orientationLock.lock("landscape")

 to lock your screen to landscape mode.

Once unlocked, you can track orientation changes with the regular orientationchange event:

window.addEventListener("orientationchange", function() {
   alert(window.orientation);
});

Other way is to use CSS and javascript :

@media screen and (orientation:landscape) {

  #container {
    -ms-transform: rotate(-90deg); /* IE 9 */
    -webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */
    transform: rotate(-90deg);
    width: /* screen width */ ;
    height: /* screen height */ ;
    overflow: scroll;
  }
}
Community
  • 1
  • 1
Kurenai Kunai
  • 1,842
  • 2
  • 12
  • 22