Part of the Apple Web Kit is the command “onorientationchange”. We will use that to detect the orientation change and call a script called “updateOrientation()”.
Add the following command to the BODY tag:
Place the following function in the HEAD of the document and call certain widgets at the specific orientation angles of 0°, -90°, and 90°. You can call any type of widget adjusting the position of a servo, controlling a digital output, or setting the state of an X10 widget.
case 0: widgetExecute("Upright Widget ID");
case -90: widgetExecute("Right Widget ID");
case 90: widgetExecute("Left Widget ID");
Place the widgets referenced in the BODY of the document.
The full iTurn web app is on the Wiki: