0

I have a website for iPad and I want visitors to see it in portrait only. Is it possible to prevent Safari/iPad to go in landscape mode?

Thanks in advance for your replies.

Cheers, Robert

mplungjan
  • 169,008
  • 28
  • 173
  • 236
rjjonker
  • 73
  • 1
  • 9
  • possible duplicate of [Prevent orientation change in iOS Safari](http://stackoverflow.com/questions/5298467/prevent-orientation-change-in-ios-safari) – Davide Gualano Feb 09 '12 at 13:21
  • First detect it: http://stackoverflow.com/questions/3495678/how-to-find-out-if-ipad-is-in-landscape-portrait-mode-in-javascript-jquery – mplungjan Feb 09 '12 at 13:22

2 Answers2

1

It’s not possible to prevent this. It’s a browser feature, and this cannot be controlled using JavaScript.

Mathias Bynens
  • 144,855
  • 52
  • 216
  • 248
0

Everyone says you can't do this, but you can hackity hack it. I do not advise unless you really have to, but you could use js to detect orientation change, and upon that change use css3 to rotate a full wrapper div 90 degrees ( transform: rotate )

Fresheyeball
  • 29,567
  • 20
  • 102
  • 164