简体   繁体   English

在我的情况下如何强制ipad进入横向模式

[英]how to force ipad to landscape mode in my case

I am trying to force iPad web browser page and the browser to landscape mode when the user clicks a link. 当用户单击链接时,我试图强制iPad Web浏览器页面和浏览器进入横向模式。

I have something like 我有类似的东西

<div>
    <a ng-click="click me()" href="www.cnn.com">Click me</a>
</div>

I know I can add CSS like this 我知道我可以像这样添加CSS

@media screen and (orientation: portrait){
    html {
        -webkit-transform: translateY(-100%) rotate(90deg);
        transform: translateY(-100%) rotate(90deg);
        -webkit-transform-origin: left bottom;
        transform-origin: left bottom;
    }
}

to transfer landscape mode. 转移风景模式。 However, I was hoping to force entire iPad to landscape mode (meaning the browser address bar, tabs..etc will be switch to the side too not just webpage). 但是,我希望强制将整个iPad设置为横向模式(这意味着浏览器地址栏,tabs..etc也将切换到侧面,而不仅仅是网页)。

Is there anything I can do to accomplish this? 我有什么可以做的吗? Thanks a lot! 非常感谢!

You can't basically. 你基本上不能。 I know no one likes lectures and all but you should design your webpage to look brilliant in both portrait and landscape mode. 我知道没有人喜欢讲座,但所有人都喜欢,但是您应该设计自己的网页,使其在纵向和横向模式下看起来都很棒。 Or, you could design something which asks them to rotate their screen... or do some JavaScript trickery as follows: Detect iPad orientation change 或者,您可以设计一些要求他们旋转屏幕的东西……或执行一些JavaScript技巧,如下所示: 检测iPad方向的变化

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

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