检测设备翻转

<link rel='stylesheet' media='screen and(orientation:portrait)' href='portrait.css' />

<link rel='stylesheet' media='screen and(orientation:landscape)' href='landscape.css' />

 

<script>

window.addEventListener('orientationchange',function(obj){

  //这里编写触发屏幕转换时的函数

})

</script>

posted on 2015-08-26 11:37  起舞弄清影wy  阅读(136)  评论(0编辑  收藏  举报