css 景观轮换通知

Posted

tags:

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

  $(window).bind('orientationchange', function(e) {
    switch ( window.orientation ) {
      case 0:
      $('.turnDeviceNotification').css('display', 'none');
      $('.mobile-menu').css('display' , 'block');
      // The device is in portrait mode now
      break;

      case 180:
      $('.turnDeviceNotification').css('display', 'none');
      $('.mobile-menu').css('display' , 'block');
      // The device is in portrait mode now
      break;

      case 90:
      // The device is in landscape now
      $('.turnDeviceNotification').css('display', 'block');
      $('.mobile-menu').css('display' , 'none');
      break;

      case -90:
      // The device is in landscape now
      $('.turnDeviceNotification').css('display', 'block');
      $('.mobile-menu').css('display' , 'none');
      break;
    }
  });
  <div class="turnDeviceNotification">
    <img src="<?php bloginfo('template_directory')?>/imgs/footer-logo.png" title="<?php bloginfo('description') ?>" class="center margin-bottom-mb">
    <h1>Welcome to BlackBee</h1>
    <p>For optimal viewing experience please rotate your device</p>
  </div>
.turnDeviceNotification {
  background-color: #0c223f;
  padding: 50px 0 0;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  display: none;
}

.turnDeviceNotification h1 {
  color: #ff5000;
  text-align: center;
  padding: 0 0 10px;
  margin: 0;
}

.turnDeviceNotification p {
  color: #fff;
  text-align: center;
}

以上是关于css 景观轮换通知的主要内容,如果未能解决你的问题,请参考以下文章

CSS 减少Css轮换

CSS 使用CSS进行文本轮换

css 智能手机景观异常的动态图像缩放

CSS 文字轮换

Spotify 中 CSS 轮换的高 CPU 使用率

html中css怎样实现点击轮换效果轮播画面