orientationchange
<!DOCTYPE html>
<html>
<head>
<title>OrientationChange Event Example</title>
<script type="text/javascript" src="EventUtil.js"></script>
</head>
<body>
<div id="myDiv">Calculating orientation...</div>
<div>This will only work on Safari on the iPhone or iPod Touch.</div>
<script type="text/javascript">
EventUtil.addHandler(window, "load", function(event){
var div = document.getElementById("myDiv");
div.innerHTML = "Current orientation is " + window.orientation; EventUtil.addHandler(window, "orientationchange", function(event){
div.innerHTML = "Current orientation is " + window.orientation;
});
}); </script>
</body>
</html>
orientationchange的更多相关文章
- orientationchange不管用啊
首先引入JQuery Mobile包,将 <script> //手持设备方向改变时执行 $(window).bind( 'orientationchange', function(e){ ...
- [Phonegap+Sencha Touch] 移动开发26 Android下的sencha touch程序,转屏时,Ext.Viewport不能触发orientationchange事件的解决的方法
Sencha touch 2.4.2 已经解决问题了. 比方你为Ext.Viewport的orientationchange事件加入了一个监听方法: Ext.Viewport.on('orientat ...
- Firefox mobile (android) and orientationchange
Firefox for Android does not support the orientationchange event but you can achieve the same result ...
- 获取屏幕翻转:var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',这段是为了获取移动端屏幕是否翻转(手机重力 ...
- orientationchange事件
orientationchange事件 resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize':
- 移动端的设备提供了一个事件:orientationChange事件
移动端的设备提供了一个事件:orientationChange事件:https://blog.csdn.net/gong1422425666/article/details/79001836
- orientationchange的兼容性
移动webapp监测屏幕旋转时常用onorientationchange事件,用此事件获取改变后的屏幕尺寸时需要注意: 1. iphone中,可立即获取改变后的屏幕尺寸. 2. android中,获取 ...
- 几个有趣的WEB设备API(二)
浏览器和设备之间还有很多有趣的接口, 1.屏幕朝向接口 浏览器有两种方法来监听屏幕朝向,看是横屏还是竖屏. (1)使用css媒体查询的方法 /* 竖屏 */ @media screen and (or ...
- CSS3与页面布局学习总结(四)——页面布局大全
一.负边距与浮动布局 1.1.负边距 所谓的负边距就是margin取负值的情况,如margin:-100px,margin:-100%.当一个元素与另一个元素margin取负值时将拉近距离.常见的功能 ...
随机推荐
- 测试redis+keepalived实现简单的主备切换【转载】
转自: 测试redis+keepalived实现简单的主备切换 - Try My Best 尽力而为 - ITeye技术网站http://raising.iteye.com/blog/2311757 ...
- CentOS6.5 常用命令
卸载 rpm -e XXX yum -y remove XXX 查看内核版本 cat /proc/version
- Linux基本命令之用户系统相关命令
1.格式说明 [simon@localhost simon]$ [simon@localhost ~]$ 这两种方式表示相同.simon是指定用户,localhost是计算机名字,如果不设置默认为lo ...
- Gulp自动构建前端开发一体化
gulp是基于Nodejs的自动任务运行器, 她能自动化地完成 javascript/coffee/sass/less/html/image/css 等文件的的测试.检查.合并.压缩.格式化.浏览器自 ...
- 关于WebAPI安全认证的问题
之前项目遇到了一个对外提供API的问题,有些粗浅的想法,抽空记录下. 以下所讨论的都是要解决:谁有资格调用这个API的问题(谁有权限进行这个操作的问题) 为了简化思路,就拿一个查看Java班级的学生举 ...
- CultureInfo中重要的InvariantCulture
CultureInfo简述 CultureInfo类位于System.Globalization命名空间内,这个类和这个命名空间许多人都不了解也认为不需要太多了解,实际上,你写的程序中会经常间接得使用 ...
- PHP 代码跟踪
怎么知道代码的执行过程呢,也就是说怎么知道:是先执行哪些代码,然后执行哪些代码呢? 这里有一个非常犀利的函数,可以让你知道代码的执行过程 debug_backtrace() 函数. 来一段代码: L ...
- oracle与SqlServer连接串服务器地址
SQLSERVER数据库可在连接串中指定服务器: ORACLE在监听中指定服务器地址.
- PAT (Advanced Level) 1027. Colors in Mars (20)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> ...
- CodeForces 614A Link/Cut Tree
#include<cstdio> #include<cstring> #include<cmath> #include<stack> #include& ...