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:
- $(function() {
- onChangeOrientationResize = function() {
- $('body').removeClass('portrait landscape').addClass(window.orientation ? 'landscape' : 'portrait');
- };
- if ("onorientationchange" in window === false) {
- window.addEventListener("resize", onChangeOrientationResize, false);
- onChangeOrientationResize();
- }
- });