<!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的更多相关文章

  1. orientationchange不管用啊

    首先引入JQuery Mobile包,将 <script> //手持设备方向改变时执行 $(window).bind( 'orientationchange', function(e){ ...

  2. [Phonegap+Sencha Touch] 移动开发26 Android下的sencha touch程序,转屏时,Ext.Viewport不能触发orientationchange事件的解决的方法

    Sencha touch 2.4.2 已经解决问题了. 比方你为Ext.Viewport的orientationchange事件加入了一个监听方法: Ext.Viewport.on('orientat ...

  3. Firefox mobile (android) and orientationchange

    Firefox for Android does not support the orientationchange event but you can achieve the same result ...

  4. 获取屏幕翻转:var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'

    var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',这段是为了获取移动端屏幕是否翻转(手机重力 ...

  5. orientationchange事件

    orientationchange事件 resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize':

  6. 移动端的设备提供了一个事件:orientationChange事件

    移动端的设备提供了一个事件:orientationChange事件:https://blog.csdn.net/gong1422425666/article/details/79001836

  7. orientationchange的兼容性

    移动webapp监测屏幕旋转时常用onorientationchange事件,用此事件获取改变后的屏幕尺寸时需要注意: 1. iphone中,可立即获取改变后的屏幕尺寸. 2. android中,获取 ...

  8. 几个有趣的WEB设备API(二)

    浏览器和设备之间还有很多有趣的接口, 1.屏幕朝向接口 浏览器有两种方法来监听屏幕朝向,看是横屏还是竖屏. (1)使用css媒体查询的方法 /* 竖屏 */ @media screen and (or ...

  9. CSS3与页面布局学习总结(四)——页面布局大全

    一.负边距与浮动布局 1.1.负边距 所谓的负边距就是margin取负值的情况,如margin:-100px,margin:-100%.当一个元素与另一个元素margin取负值时将拉近距离.常见的功能 ...

随机推荐

  1. dubbo Forbid blacklist

    http://www.jameswxx.com/dubbo/%E8%A7%A3%E5%86%B3dubbo%E9%97%AE%E9%A2%98%EF%BC%9Aforbid-consumer/

  2. 转 android学习—— context 和 getApplicationContext()

    在android中常常会遇到与context有关的内容 浅论一下context : 在语句 AlertDialog.Builder builder = new AlertDialog.Builder( ...

  3. C#入门经典第十章类的成员-1

    类成员的访问级别 public   成员可以由任何代码访问,公共的. private 私有的,成员只能有类中的代码访问.(默认的关键字) internal 内部的,成员只能有定义它的程序集(项目)内部 ...

  4. C#入门经典第八章面向对象编程简介-1

    面向对象编程(Object-Oriented Programming,OOP)技术 本章中的OPP实际上是.NET OOP,这里讲的一些技术不能应用于其他OOP环境.

  5. android脚步---将layout和其输出一起保存成图片

    public void convertViewToBitmap(View view) { //View view = getLayoutInflater().inflate(R.layout.test ...

  6. [转] Linux下移动virtualbox虚拟硬盘丢失eth0

    1.遇到什么的问题(What)      在新的virtualbox虚拟机上挂上曾使用过的虚拟硬盘,在启动的时候,发现找不到网卡eth0, 在输入ifconfig –a的时候,也没有任何Ethnet的 ...

  7. ARM系统中函数调用过程中的参数传递-转

    在 嵌入式软件编程中,经常会用到函数调用,之前在学习如何在C语言中嵌入汇编时有了解到C语言之前的参数调用是使用寄存器R0传递第一个参数,R1传递到第 二个..一直到R3传递第四个参数.但是实际上有时可 ...

  8. Tickets 基础DP

    Tickets Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

  9. Keepalived详细介绍简介

    1.1.Keepalived简介 Keepalived是Linux下一个轻量级别的高可用解决方案.高可用(High Avalilability,HA),其实两种不同的含义:广义来讲,是指整个系统的高可 ...

  10. [转]JavaScript通过参数动态调用函数——js中eval实现反射

    以下文章出自  http://blog.rongzhiwang.com/king/archive/2012/08/13/javascriptjseval.aspx       今天碰到人问这样一个问题 ...