DextrousDave DextrousDave - 1 year ago 74
CSS Question

Refreshing page automatically when viewport size change

I'm using responsive and adaptive media queries for my website to accommodate smartphones...Now the problem is that my max-width mobile query ends at 480px, which is most phones rotated display width (when the phone is on its side...). Now some phones, like the HTC desire have a max screen width of 533px, now when the user first loads the page on vertical position (320px screen width) and he/she rotates rotates the screen to 533px width, it goes past my design specifications and it looks kinda crappy...(since the layout was meant for 480px max...)

Now the only way to solve that is to refresh the page once the viewport dimensions change. How do I force a refresh?

Thank you

Answer Source

if device rotate window resized.

window.onresize = function(event)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download