检测设备翻转

<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>

原文地址:https://www.cnblogs.com/wangyingblog/p/4759887.html