Skip to content

Instantly share code, notes, and snippets.

View msreddy09's full-sized avatar

Sudhakar Reddy Medagam msreddy09

View GitHub Profile
@msreddy09
msreddy09 / gist:4419471
Created December 31, 2012 12:38
I am not getting correct device pixel ratio in FF of mobile devices
var ratio = window.devicePixelRatio ||
(function(i){
var wmq = window.matchMedia;
while( !window.devicePixelRatio && i > 0 &&
!wmq("(min--moz-device-pixel-ratio:" + i/10 + ")").matches ){
i=i-1;
}
return i/10;
})(30);