I’m trying to make a website for mobile. I’m having the "resize" event bounded on window, which should rearrange elements when the mobile device is turning (portrait <-> landscape). On iPhone and Samsung Galaxy SII, the event is triggered when I’m scrolling down the page, and that’s not good.
How can I fix this?
Use the
onOrientationChangeevent and thewindow.orientationproperty instead.Also see this answer.
Here link to a test page.