<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<title>测试</title>
<style type="text/css">
*{ margin:0; padding:0;}
body{ width:100%; height:auto; overflow:auto;}
#sm{font-size: 40px; background: #ff0}
</style>
</head>
<script src="Public/media/admin/js/jquery-1.9.1.js"></script>
<script type="text/javascript">
var updateOrientation = function(){if(window.orientation=='-90' || window.orientation=='90'){
$("#sm").css("display","none");
}else{
$("#sm").css("display","block");
}};
window.onorientationchange = updateOrientation;
</script>
<body>
<div id="sm">123</div>
</body>
</html>
监听手机是否横屏
最新推荐文章于 2024-05-15 15:52:37 发布