<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
div {
width: 100%;
}
input {
width: 100%;
font-size: 30px;
}
</style>
<script type="text/javascript">
window.addEventListener('orientationchange', clientrotate)
function clientrotate() {
if (window.orientation == 0 || window.orientation == 180) {
window.location.href = window.location.href;
window.location.reload;
} else if (window.orientation == 90 || window.orientation == -90) {//横屏
window.location.href = window.location.href;
window.location.reload;
}
}
</script>
</head>
<body>
<div>
<input type="text" autocomplete="on">
</div>
</body>
</html>
移动端监测界面旋转
最新推荐文章于 2024-07-30 17:19:26 发布