Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox mobile (android) and orientationchange

The event is not working in firefox mobile for android.

How do I detect the orientation change after all?

like image 924
Alon Avatar asked Aug 31 '25 16:08

Alon


1 Answers

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(); });
like image 189
Corban Brook Avatar answered Sep 02 '25 11:09

Corban Brook