摘要: 监听旋转:window.addEventListener(‘deviceorientation’, rotateScene, false);可以通过获取window.orientation的属性值来进行判断:横向:Math.abs(window.orientation) == 90;纵向:window.orientation == 0;旋转角度:var theta = (Math.abs(window.orientation) == 90) ? e.beta : e.gamma; rotationY = 0 + (15 * (theta / -45));执行旋转:$scene.css... 阅读全文
posted @ 2012-07-25 11:01 华丽@低调 阅读(282) 评论(0) 推荐(0)
摘要: 让IE支持HTML5的方法 让 IE(包括IE6)支持HTML5元素,我们需要在HTML头部添加以下JavaScript,这是一个简单的 document.createElement声明,利用条件注释针对IE来调用这个js文件。Opera,FireFox等其他非IE浏览器就会忽视这段代码,也不会存在http请求。 < !?[if IE]> < script src=”http://html5shiv.googlecode.com/svn/trunk/html5.js”> < ![endif]?> 上面这段代码仅会在IE浏览器下运行,还有一点需要注意,在页面中 阅读全文
posted @ 2012-07-24 18:48 华丽@低调 阅读(301) 评论(0) 推荐(0)