如果 ipad 处于横向模式,我想添加一个额外的 div。 是否有某种 if 语句可以找出这一点?
谢谢
最佳答案
jQTouch 是这样检查的:
orientation = Math.abs(window.orientation) == 90 ? 'landscape' : 'portrait';
http://github.com/senchalabs/jQTouch/blob/master/jqtouch/jqtouch.js
你也可以监听onorientationchange事件
查看之前的回答:Detect rotation of Android phone in the browser with JavaScript
关于javascript - 如何确定 ipad 在 javascript/jquery 中是否处于横向/纵向模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3495678/