1

I am trying to force iPad web browser page and the browser to landscape mode when the user clicks a link.

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

@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).

Is there anything I can do to accomplish this? Thanks a lot!

FlyingCat
  • 14,036
  • 36
  • 119
  • 198
  • 1
    I dont think you can do that... and also that you should do that. Its up to the user to decide how they want to view the website. – Pablo Rincon Dec 12 '14 at 19:24

1 Answers1

2

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

Community
  • 1
  • 1
XeonFibre
  • 33
  • 5