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取负值时将拉近距离.常见的功能 ...
随机推荐
- Base64笔记
1. 昨天的<MIME笔记>中提到,MIME主要使用两种编码转换方式----Quoted-printable和Base64----将8位的非英语字符转化为7位的ASCII字符. 虽然这样的 ...
- JavaScript返回上一页并自动刷新
返回并刷新 <script>alert("恭喜您,操作成功!"); window.location.href=document.referrer; </scrip ...
- 使用nodejs的net模块创建TCP服务器
使用nodejs的net模块创建TCP服务器 laiqun@msn.cn Contents 1. 代码实现 2. 使用telnet连接服务器测试 3. 创建一个TCP的client 1. 代码实现 ; ...
- Android命令行工具logcat详细用法!
logcat是Android中一个命令行工具,可以用于得到程序的log信息. 见板凳详细说明! 本贴内容来自网络,引用网址为:http://hi.baidu.com/%C9%C1%D2%AB% ...
- eclipse中创建NDK和JNI开发环境最简单配置方法
一.使用环境 1.windows64位操作系统 2.ADT为adt-bundle-windows-x86_64-20130917 3.NDK为android-ndk-r9b 二.配置生成头文件.h ⒈ ...
- ecma6的学习好网站
http://www.nodeclass.com/api/ECMAScript6.html#function http://es6.ruanyifeng.com/#docs/destructuring ...
- 一道变态的js题
一道腾讯js面试题 题目如下: f = function() {return true;}; g = function() {return false;}; (function() { if (g() ...
- Selenium IDE安装
1. 网上下载firefox30版本 http://www.9ht.com/xz/78637.html#addressWrap Selenium IDE 2.9.0下载 http://www.pc ...
- php 系列
1.给 跑在windows 环境下的php, 安装redis 拓展.(installing Redis & Redis extension in PHP on XAMPP on windows ...
- 【HighCharts系列教程】四、颜色属性——colors
一.Colors属性说明 配置Colors,可以自定义数据列的颜色. 默认下colors就包含一系列颜色,在个性化或需要调整颜色的顺序下,我们可以配置该属性. 二.colors属性详解 Colors属 ...