1

I have 2 pages in my JQuery Mobile project. I would like Page 1 to be fixed to Portrait and Page 2 to be fixed to Landscape.

Can it be done?

newpc100
  • 96
  • 1
  • 12

1 Answers1

0
when you click on a link to open page then check window.orientation, then change your page accordingly . As well as implement event orientationchange and whenever orientation is changed then open the relevent page.

you can use following to change/ browse to relevent page

$.mobile.changePage("#LandscapePage", { transition: "slide" });

if you need furthur assistance then plz ask

Tanveer
  • 1,937
  • 3
  • 24
  • 40
  • I just want to find a way to automatically rotate the page when the user selects Page 2. So, I just need to find a way to set the orientation of that page. Is it through JQuery Mobile? – newpc100 May 08 '12 at 07:38
  • I fear that this is not possible becuase you cannot lock orientation even by Xode, what you can do is to detect the orientation and try to rotate you page body accordingly i.e. $('body').css({ "-webkit-transform": "rotate(" + new_orientation + "deg)" }); . you can get help from similar post http://stackoverflow.com/questions/7009743/jquery-mobile-lock-orientation – Tanveer May 08 '12 at 09:12