Page refresh automatically when resizing viewport

I use flexible and adaptive media queries for my website to host smartphones ... Now the problem is that my mobile request with a maximum width ends at 480 pixels, which is the majority of phones with a wide screen width (when the phone is on its side...). Now some phones, such as HTC, have a maximum screen width of 533px, now when the user first loads the page in a vertical position (screen width of 320 pixels) and he rotates, rotates the screen to a width of 533 pixels, he goes through my design specifications and he looks a bit cheesy ... (since the layout was designed for 480px max ...)

Now the only way to solve this is to refresh the page after resizing viewports. How to force update?

thanks

+6
source share
1 answer

if the device rotation window has changed.

window.onresize = function(event) { document.location.reload(true); } 
+9
source

Source: https://habr.com/ru/post/923316/


All Articles