Detect iPad orientation change

lolalola picture lolalola · Jun 6, 2011 · Viewed 40.5k times · Source

How to detect with or when user turns iPad from vertical position to horizontal or from horizontal to vertical?

Answer

Karl-Bjørnar Øie picture Karl-Bjørnar Øie · Jun 6, 2011

Try

$(window).bind('orientationchange', function(event) {
  alert('new orientation:' + event.orientation);
});