JavaScript iPhone Orientation Javascript

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript iPhone Orientation Javascript相关的知识,希望对你有一定的参考价值。

<script type="text/javascript">  
 function orient()  
 {  
     switch(window.orientation){    
             case 0: document.getElementById("orient_css").href = "css/iphone_portrait.css";  
             break;  
   
             case -90: document.getElementById("orient_css").href = "css/iphone_landscape.css";  
             break;  
               
             case 90: document.getElementById("orient_css").href = "css/iphone_landscape.css";  
             break;  
   
 }  
   
 window.onload = orient();  
   
   
 </script>

以上是关于JavaScript iPhone Orientation Javascript的主要内容,如果未能解决你的问题,请参考以下文章