Skip to content

Instantly share code, notes, and snippets.

@gjcourt
Created October 29, 2010 07:19
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjcourt/653079 to your computer and use it in GitHub Desktop.
Save gjcourt/653079 to your computer and use it in GitHub Desktop.
get the scale on all iDevices
function scale() {
return document.body.clientWidth / window.innerWidth;
}
@jayarjo
Copy link

jayarjo commented Oct 9, 2012

Does this work if meta viewport width is set to specific value, for example - 960px?

@panzi
Copy link

panzi commented May 22, 2014

I gather this only works on the iPhone? It does not work on Desktop Chrome.

@robsongajunior
Copy link

  • there are many post with this calcule, but I didn't understand when it's working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment