简体   繁体   English

覆盖移动设备上的方向偏移

[英]Override orientation shift on a mobile device

I'm sure the answer varies from platform to platform, but is there any way to override a phone's ability to switch from portrait to landscape when you turn the phone? 我确定答案因平台而异,但是当您转动手机时,是否有任何方法可以超越手机从纵向切换到横向的功能? I've noticed apps doing this (eg. Instagram) but I'd like to implement this on a mobile version of website. 我注意到有应用程序在执行此操作(例如Instagram),但我想在移动版本的网站上实现此操作。

Anybody know of a way to do this? 有人知道这样做的方法吗?

So, apparently this is possible with the @viewport css meta selector . 因此,显然可以使用@viewport css元选择器来实现 So: 所以:

@viewport{
    orientation: landscape;
}

I have no idea how well supported this is nor, it seems, do Mozilla. 我不知道Mozilla是否也提供了很好的支持。 I'd eat my hat if it works consistently! 如果能持续工作,我会戴上帽子!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM