Skip to content

Instantly share code, notes, and snippets.

@mitio
Created November 8, 2012 15:54
Show Gist options
  • Save mitio/4039662 to your computer and use it in GitHub Desktop.
Save mitio/4039662 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<title></title>
<style type="text/css">
#wrapper { padding-top: 650px; background-color:#ddd;}
</style>
<script src="/javascripts/zepto.js"></script>
<script>
$(function () {
var test = function () {
var D = document;
var res = [];
var sizes = {
'window.innerHeight': window.innerHeight,
'window.outerHeight': window.outerHeight,
'body.scrollHeight': D.body.scrollHeight,
'documentElement.scrollHeight': D.documentElement.scrollHeight,
'body.offsetHeight': D.body.offsetHeight,
'documentElement.offsetHeight': D.documentElement.offsetHeight,
'body.clientHeight': D.body.clientHeight,
'documentElement.clientHeight': D.documentElement.clientHeight,
'window.pageYOffset': window.pageYOffset,
};
for (var k in sizes) {
res.push(k + ': ' + sizes[k]);
}
$('#log').html(res.join('<br/>'));
};
$('#test').click(test);
setInterval(test, 100)
});
</script>
</head>
<body>
<div id="wrapper">
<div id="log">
</div>
<input type="text" />
<input type="button" id="test" value="Test" />
</div>
<!-- <div style="height: 500px; background-color: #ccf;"></div> -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment