I’m trying to figure out how to change an embedded web page when the user rotates their phone from portrait to landscape mode – basically to load a view that is better suited to the wider screen format. Is this possible to do without calling a new page from the server, i.e. to drive it from within CSS/Javascript itself?
Thanks!
You can use the
window.orientationproperty. Its value is the degree that the current mode of view is used. Here is a brief example:You can use this function on this event:
Hope that helps!