检测iPhone 5/iOS 6

 

检测iOS 6很简单,用ua就可以了:

Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25

但是刷了iOS 6的所有iPhone的ua都是这个,那么判断是否是iPhone 5就要用js或者media query的方法了:

js:

isPhone4inches = (window.screen.height==568);

CSS:

@media (device-height: 568px) and (-webkit-min-device-pixel-ratio: 2) {
/* iPhone 5 or iPod Touch 5th generation */
}
 

HTML5支持:

file api:
input type="file"><!--单文件-->
<input type="file" multiple> <!--多文件—>

只能上传图片和视频,不允许上传其他格式

*远程调试
新的远程调试工具可以更方便的在PC/Mac上对iOS上Safari中的页面进行调试,界面类似Android上的Chrome浏览器。

相关文章:

  • 2021-12-02
  • 2021-04-17
  • 2022-12-23
  • 2021-12-29
  • 2021-05-17
  • 2021-10-09
  • 2022-12-23
  • 2022-01-02
猜你喜欢
  • 2022-02-07
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
相关资源
相似解决方案