我正在为Ipad开发一个应用程序。所以我需要改变图像渲染,这取决于它是ipad还是ipad-retina。那么有人能告诉我如何检测ipad和ipad-retina之间的区别吗?感谢名单!!!!!!!
答案 0 :(得分:1)
var isRetina = window.devicePixelRatio > 1;
答案 1 :(得分:0)
var retina = (window.retina || window.devicePixelRatio > 1);
资源:http://hjzhao.blogspot.in/2012/07/detect-retina-display-using-javascript.html
也使用Modernizr
https://github.com/benlister/utilities/tree/master/Modernizr%20Retina%20:%20HiDPI%20test