Orientation change doesn't get detected

Hi @Darko,

Thank you for your answer.
That’s weird… that example didn’t work on my mobile devices either.
As stated here, it seems to be a bug indeed.
That page also referred to your example.

I have found a solution though.

window.onresize = function (){
   if(window.innerWidth > window.innerHeight){
     // landscape
   }
   else{
     // portrait
   }
};

Now it works well across all my devices.

3 Likes