I am trying to turn off the phone rotation affecting the web page of one of my HTML5 mobile apps. Lack of reorganization of the layout, resizing, changing orientation.
I want you to rotate the phone and the downloadable original layout remains the same, forcing the user to use the application in its original orientation. There is a lot of subtleties in user logic, and I really feel that it is necessary in my application, so please do not leave any comments on this choice, rather help my question in the first sentence.
I tried listening to BOTH "changechange" and "resizing" events and calling the preventDefault and stopPropagation functions on them to prevent the browser behavior from changing when viewing the landscape view when it changes. Well, obviously, preventing ANYTHING (ideally).
window.addEventListener("orientationchange", function (e) { e.preventDefault(); e.stopPropagation(); }, false); window.addEventListener("resize", function (e) { e.preventDefault(); e.stopPropagation(); }, false);
Made absolutely no difference. The browser is still reorganizing the page on Android (both pre2.1 and after) and iPhone 4-5.
proven meta tags
<meta name="viewport" content="initial-scale=1.0, user-scalable=no />
then got angry, tried
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" />
not changed.
I looked fiercely at StackOverflow, saw what I did in step 1. I exposed it several times ... again tried to make sure that I wasnโt messing around. Does not work.
sucked my pride, then decided to continue working in the brick wall because of pride, and then really pulled in his pride and placed it here.
HALP.
javascript android html5 iphone mobile
Spillai
source share