Skip to content

Instantly share code, notes, and snippets.

@gabrysiak
Created August 14, 2014 19:49
Show Gist options
  • Save gabrysiak/77905492e99290c98916 to your computer and use it in GitHub Desktop.
Save gabrysiak/77905492e99290c98916 to your computer and use it in GitHub Desktop.
// VIEWPORT FIX
documentWidth = $(document).width();
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
viewport = document.querySelector("meta[name=viewport]");
viewport.setAttribute('content', 'width=' + documentWidth);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment