While creating a website for iPad Mobile Safari, I have a few questions;
- Does the orientation happen automatically or do we have to write code for that ?
- What is the best approach in terms of CSS/JS..I mean create separate copy of the web CSS for iPad and just update for iPad specific. Also what about JS?
- What is the best way to detect for iPad (CSS/JS) and how?
Any online references which specificall开发者_运维知识库y covers iPad Mobile Safari development will also be great. Thank you.
The orientation happens automatically, but you can write code to intercept the event and do things.
I highly recommend using an existing JS library such as Sencha Touch to handle the UI for you; they automatically detect the client and will display the appropriate scale of the app.
I just added a few meta tags to my current project, based on this page - http://www.nczonline.net/blog/2010/04/06/ipad-web-development-tips/
It made a huge difference. The orientation media queries work great. I madea simple example by setting the body background colour different based on orientation.
精彩评论