一直在使用modernizr和css媒体查询进行测试,以在不同设备上查看结果。我添加了一个-webkit-device-pixel-ratio:2的测试来检测何时有一个视网膜显示设备,然后它会执行一个小的jquery脚本将图像插入到页面中。Modernizr Pixel Ratio媒体查询
但是脚本没有得到执行,而是调用了另一个测试的回调函数。任何想法,为什么这是?已经在ipad 2,iphone 4和android模拟器上测试过。
纯CSS媒体查询的作用就像一个魅力,并插入一条消息。 Modernizr mq测试似乎不起作用。
/*
* Retina Display Test
*/
{
test: Modernizr.mq('-webkit-device-pixel-ratio:2'),
yep: 'js/retina.js',
nope: 'js/regular.js',
},//end retina test
https://dl.dropbox.com/u/85173358/devicewidth/orientation.html