html5 - How to reload the webpage when orientation changes? -


i'm trying trigger event jquery mobile automatically reloads page when device's orientation changes. have media queries written max-device-width, orientation:landscape, , orientation: portrait. since <video> wont scale properly...the solution can think of refresh page correct media query device rotated.

how go doing this? thanks.

thanks guys answered found , used , worked perfectly.

<script type="text/javascript"> // reloads webpage when mobile orientation changes       window.onorientationchange = function() {          var orientation = window.orientation;              switch(orientation) {                  case 0:                 case 90:                 case -90: window.location.reload();                  break; }      }; 


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -