Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change orientation on Phonegap JQuery mobile

Hi i write simple app using jqm and phonegap, and i have some problem with change orientation. I need to change orientation on one page. I can change values "Supported interface orientations" but it work on all pages, may be exist way to change orientation on one page ?

like image 433
Sergio Avatar asked Dec 12 '25 12:12

Sergio


1 Answers

You can use this plugin.

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

To lock the screen to Landscape:

navigator.screenOrientation.set('landscape');

To lock the screen to Portrait:

navigator.screenOrientation.set('portrait');

To unlock:

navigator.screenOrientation.set('fullSensor');
like image 174
nbk Avatar answered Dec 14 '25 09:12

nbk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!