Skip to content

Instantly share code, notes, and snippets.

@omo
Last active September 30, 2015 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omo/07754cdb29025d08bf43 to your computer and use it in GitHub Desktop.
Save omo/07754cdb29025d08bf43 to your computer and use it in GitHub Desktop.
More viewport experiment
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='initial-scale=1, width=device-width, height=device-height' />
<script>
window.addEventListener('load', function() {
var c = document.getElementById('console');
c.innerHTML = ("w=" + window.innerWidth + " h=" + window.innerHeight);
});
</script>
</head>
<body>
Hello!
<pre id='console'></pre>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='initial-scale=1, width=2540, height=2540' />
<script>
function show() {
var c = document.getElementById('console');
c.innerHTML = ("w=" + window.innerWidth + " h=" + window.innerHeight);
}
window.addEventListener('load', show);
</script>
</head>
<body>
<button onclick='show()'>Hello!</button>
<pre id='console'></pre>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment