iPad 移动 Safari 网站
在为 iPad Mobile Safari 创建网站时,我有几个问题;
- 方向是自动发生还是我们必须为此编写代码?
- 就 CSS/JS 而言,最好的方法是什么?我的意思是为 iPad 创建单独的 Web CSS 副本,然后针对 iPad 进行更新。还有JS呢?
- 检测 iPad (CSS/JS) 的最佳方法是什么以及如何进行?
任何专门涵盖 iPad Mobile Safari 开发的在线参考资料也会很棒。 谢谢。
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 specifically covers iPad Mobile Safari development will also be great.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
方向会自动发生,但您可以编写代码来拦截事件并执行操作。
我强烈建议使用现有的 JS 库,例如 Sencha Touch 来为您处理 UI;它们会自动检测客户端并显示应用程序的适当比例。
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.
我刚刚根据此页面向当前项目添加了一些元标记 - http://www.nczonline.net/blog/2010/04/06/ipad-web-development-tips/
它产生了巨大的变化。方向媒体查询效果很好。我做了一个简单的例子,根据方向设置不同的主体背景颜色。
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.