-
移动端判断是否处于横屏还是竖屏状态
- style>
- @media screen and (orientation:portrait) {
- /* portrait-specific styles */
- }
- /* landscape */
- @media screen and (orientation:landscape) {
- /* landscape-specific styles */
- }
- </style>
- <script type="text/javascript">
- var mql = window.matchMedia("(orientation: portrait)");
- if(mql.matches) {
- alert("竖屏");
- } else {
- alert("横屏");
- }
- // 添加一个媒体查询改变监听者
- mql.addListener(function(m) {
- if(m.matches) {
- alert("竖屏");
- }
- else {
- alert("横屏");
- }
- });
- </script>
-
相关阅读:
处理器及其调度
java面向对象
操作系统概述
mysql 基础操作
java集合类详解
java数组
java方法
Python—进程间通信
Python—TCP的黏包问题以及UDP的分片问题
Python—网络通信编程之tcp非阻塞通信(socketserver)
-
原文地址:https://www.cnblogs.com/telwanggs/p/6477462.html
Copyright © 2020-2023
润新知