Friday, December 21, 2007

Apple Provides Orientation Sample Code For All You Developers


Here's a neat little goodie for you web developers: Apple has posted some sample code showing how to handle iPhone or iPod touch orientation events using JavaScript, HTML, and CSS. Using this, you can pick up orientation events in Mobile Safari that occur when a user turns their iPhone.Apple provides a sample iPhoneOrientation.js file that implements a typical handler, window.onorientationchange. CSS attributes can dynamically change how the webpage appears.
You can download the file at the Apple Developer Connection page.

No comments: