Amazon-Web-SDKs/Webapps/examples/Cookbook/ForceOrientation/
Download the Amazon Web SDKs from the SKD Download page (click the Web button).
Markup and Style
Your markup should include the content of your app, as well as a div containing a message to display when the device is not being held in the desired orientation.Orientation-Forcing Function
The orientation-forcing function relies on the value of a global variable,forcedOrientation, which is the orientation in which the user is forced to hold the device to see the app content. forcedOrientation is equal to the string “portrait” or the string “landscape”. forcedOrientation is compared to the current orientation of the window and if they do not match, the “wrong way” message is displayed. Here is the code for the orientation-forcing function:
Invoke the Orientation-Forcing Function
The orientation-forcing function needs to be called every time the screen orientation changes. To accomplish this, first detect whether orientation events are recognized. If they are, bind theforceOrientation() function to orientation events so that forceOrientation() gets called any time an orientation event is detected.

