Follow these steps to scale the UI images of your app with a few lines of JavaScript:
<img class='highRes' />
function processImages(){ var pixelRatio = window.devicePixelRatio; if(window.devicePixelRatio > 1) { var matches = document.querySelectorAll("img.highRes"); for(var i = 0; i < matches.length; i++) { matches[i].width = (matches[i].width / pixelRatio); } }
deviceready
event is fired. When using PhoneGap, it is strongly recommended that the code that needs to run at startup is executed immediately after the deviceready
event.addEventListener('deviceready', onDeviceReady); function onDeviceReady(evt){ processImages(); }
18.188.40.207