cordova - How to block Landscape Orientation mode in ONSEN-UI? -


i developing onsen application, in want allow portrait mode device , want set off landscape mode. how that?

onsen ui doesn't provide function disable landscape mode, because functionality platform dependent. can is, first, detecting orientation ons.orientation, followed platform ons.platform, , apply default platform instructions block landscape mode.

an easier solution rotate view portrait, after has been rotated in landscape.

window.addeventlistener('orientationchange', function ()  {      if (window.innerheight > window.innerwidth)      {          document.getelementsbytagname('body').style.transform = "rotate(90deg)";      }  });


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -