3
if (window.matchMedia("(min-width: 320px)").matches) {
alert("width 320"); // works
}
if (window.matchMedia("(min-width: 768px)").matches) {
alert("width 768");
}
if (window.matchMedia("(min-resolution: 2.4dppx)").matches) {
alert("2.4dppx");
}
if (window.matchMedia("(min-resolution: 217dpi)").matches) {
dpi = 217;
}
if (window.matchMedia("(min-resolution: 252dpi)").matches) {
dpi = 252;
}
if (window.matchMedia("(min-resolution: 331dpi)").matches) {
dpi = 331;
}
if (window.matchMedia("(min-resolution: 332dpi)").matches) {
dpi = 332;
}
我在Lumia 920上测试,只有width 320
工作,其他,我想知道DPI。试了一下,它的最小分辨率不起作用。Windows Mobile上的媒体查询检测
按【规范】(http://www.nokia.com/global/products/phone/lumia920/specifications/)您所有的疑问应该匹配。 – Pavlo 2013-05-01 17:19:20
确切的,但他们不是。 :( – 3zzy 2013-05-01 17:24:00