0

Iam developing a fullscreen video site.I want to change page orientation to landscape mode when a users visit the website in smartphone. I tried this using css media orientation but didnt workout.

Pease help me to work this using javascript.

  • This link might help you..http://stackoverflow.com/questions/7625718/how-to-use-javascript-conditionally-like-css3-media-queries-orientation – Nibin Oct 08 '13 at 04:07

3 Answers3

0

You cannot change the page (do you mean device?) orientation, you can only detect it (and then modify styles accordingly).

Adam Heath
  • 4,703
  • 2
  • 35
  • 50
0

How about rotating the page using css?

-webkit-transform:rotate(-90deg);
-moz-transform:rotate(-90deg);
-ms-transform:rotate(-90deg);
-o-transform:rotate(-90deg);
transform:rotate(-90deg);
Siddhartha Gupta
  • 1,140
  • 8
  • 13
  • thanks bro.but its not working when i open the site using a smartphone browser. – shyamsundar055 Oct 08 '13 at 04:35
  • You need to detect the device first, depending on that, place the above mentioned css on body and adjust the rest of css accordingly. I personally create a separate css file for such instances and load it upon the detection of device. – Siddhartha Gupta Oct 08 '13 at 05:23
-1

if you want to change the orientation of pdf say

var pdf = new BytescoutPDF();

pdf.pageSetOrientation(BytescoutPDF.PORTRAIT); // BytescoutPDF.PORTRAIT = portrait, BytescoutPDF.LANDSCAPE = landscape
    pdf.pageAdd();

    pdf.textAdd(50, 50, 'Portrait page orientation', 0);

    // add a page with landscape orientation
    pdf.pageSetOrientation(BytescoutPDF.LANDSCAPE);
    pdf.pageAdd();

    pdf.textAdd(50, 50, 'Landscape page orientation', 0);

    // return BytescoutPDF object instance
    return pdf;