如何检测屏幕旋转状态?

时间:2014-11-09 14:58:25

标签: javascript mobile-safari screen-orientation orientation-changes

我正在编写orientationchangeend事件的实现。

要检测orientationchange的结尾,我会在window.innerWidth事件被触发后跟踪window.innerHeightorientationchange的状态。如果这些值不会更改X次迭代次数(使用setInterval),则会触发orientationchangeend

我可以跟踪的是另一个变量,而不是更明确的window.innerWidth / window.innerHeight吗?旋转进度是否暴露在API中的任何位置? (例如,旋转屏幕的CSS转换;假设有一个)。

0 个答案:

没有答案