2013-10-08 31 views
0

Iam開發全屏視頻網站。我想在用戶訪問智能手機網站時將頁面方向更改爲橫向模式。我試圖使用CSS媒體定位,但沒有鍛鍊。如何使用javascript更改頁面方向?

Pease幫助我使用javascript工作。

如果你想改變PDF的方向
+0

此鏈接可能會幫助you..http://stackoverflow.com/questions/7625718/how-to-use-javascript-conditionally-like-css3-media-queries-orientation – Outlooker

回答

0

如何使用CSS旋轉頁面?

-webkit-transform:rotate(-90deg); 
-moz-transform:rotate(-90deg); 
-ms-transform:rotate(-90deg); 
-o-transform:rotate(-90deg); 
transform:rotate(-90deg); 
+0

感謝bro.but但它不工作,當我使用智能手機瀏覽器打開網站。 – shyamsundar055

+0

您需要首先檢測設備,具體取決於此,請將上述css放在身體上並相應地調整css的其餘部分。 我個人爲這些實例創建一個單獨的css文件,並在檢測到設備時加載它。 –

-1

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; 
+0

這是無關的視頻。 –

0

您不能更改的頁面(你的意思是設備?)的方向,只能檢測到它(並相應修改樣式)。

相關問題