You can be notified when the orientation changes using the onorientationchange property of the onorientationchange tag.
You can use code similar to this answer that tracks orientation changes and then flips the content so that it displays to the user in one direction as always.
Note that although you can prevent the default behavior on some events using the following code:
function touchMove(event) {
It says nothing about preventing orientation changes:
iPhone OS Note. The preventDefault method is used to enter multi-touch and gestures in iPhone OS 2.0 and later.
[highlighted by me]
In addition, the orientation property is read-only.
So you have to write your own code, like the one I linked to above.
source share