Alpha 4 - orientation change CSS don't work in android [FIXED]

Alpha 4 - orientation change CSS don't work in android [FIXED]

in my phone (Motorola Defy - android 2.1-update1) don't work the change class (portrait landscape) in orientation change.
To fix it I added after the jquery.mobile-1.0a4.js the code:


  1. $(function() {
  2.     onChangeOrientationResize = function() {
  3.         $('body').removeClass('portrait landscape').addClass(window.orientation ? 'landscape' : 'portrait');
  4.     };           
  5.     if ("onorientationchange" in window === false) {
  6.           window.addEventListener("resize", onChangeOrientationResize, false);
  7.           onChangeOrientationResize();
  8.     }
  9. });