Code snippet to capture ipad device change (IOS7) tested.

jQuery(document).ready(function($) {
//capture ipad device change (IOS7) tested.
function doOnOrientationChange()
  // alert(window.orientation);
    case 0:
    case 90:
    case -90:
Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.

  • Dustin

    This is a function which detects the current orientation on page loads, and then adds a class to the document. It in no way detects if there is an orientation change after the document has already loaded.

    • jQuery4u

      It works for me, if you know of a better way please share.

Learn JavaScript for free!
Free course: Introduction to JavaScript

Yours when you take up a free 14-day SitePoint Premium trial.