Last active
January 30, 2018 13:09
-
-
Save gmelikov/a00e12139c583bb31c41f125f1c8a607 to your computer and use it in GitHub Desktop.
html autozoom page for screen width
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add to <head>: | |
``` | |
<meta id="Viewport" name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | |
<script type="text/javascript"> | |
var ww=320; //maximum body size in pixels | |
var ratio = window.innerWidth / ww; | |
document.querySelector('meta[name="viewport"]').setAttribute("content", 'initial-scale=' + ratio + ', maximum-scale=' + ratio + ', minimum-scale=' + ratio + ', user-scalable=yes, width=' + ww); | |
</script> | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment