문제

The event is not working in firefox mobile for android.

How do I detect the orientation change after all?

도움이 되었습니까?

해결책

Firefox for Android does not support the orientationchange event but you can achieve the same result by using media query listeners.

var mqOrientation = window.matchMedia("(orientation: portrait)");

// The Listener will fire whenever this either matches or ceases to match
mqOrientation.addListener(function() { self.handleViewportChange(); });

다른 팁

this works like a charm on ff for android

$( window ).resize(function() {
  alert($( window ).height());
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top