-1

We are developing phone-gap application.We have 4 pages like one.html,two.html,three.html,four.html.In this one(two.html) of the HTML file need to be landscape mode automatically.

Please guide to us.We are new to this.

2 Answers2

1

Add this script first

<script type="text/javascript" src="cordova.js"></script>

Then inside another script tag

<script>
    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
        var so = cordova.plugins.screenorientation;
        so.setOrientation(so.Orientation.LANDSCAPE);
    }
</script>
Zealous System
  • 2,080
  • 11
  • 22
0

You can use the Screen Orientation PhoneGap Plugin for Android

Following is the link.

https://github.com/their/pg-plugin-screen-orientation

Arun Bertil
  • 4,598
  • 4
  • 33
  • 59