window.addEventListener('orientationchange', function(event){
    if ( window.orientation == 180 || window.orientation==0 ) {
         alert("竖屏");    //竖屏事件处理
    }
    if( window.orientation == 90 || window.orientation == -90 ) {
         alert("横屏");    //横屏事件处理
    }
});

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-06-05
  • 2022-03-10
  • 2022-12-23
  • 2021-08-30
猜你喜欢
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
相关资源
相似解决方案