该事件在 android 的 firefox mobile 中不起作用。
毕竟,我如何检测方向变化?
最佳答案
Firefox for Android 不支持orientationchange 事件,但您可以通过使用媒体查询监听器来实现相同的结果。
var mqOrientation = window.matchMedia("(orientation: portrait)");
// The Listener will fire whenever this either matches or ceases to match
mqOrientation.addListener(function() { self.handleViewportChange(); });
关于Firefox mobile (android) 和orientationchange,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13111075/