parent
9da455d750
commit
51c9d6814b
@ -0,0 +1,26 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>onresize test</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Resize the browser window to fire the resize event.</p>
|
||||
|
||||
<p>Window height: <span id="height"></span></p>
|
||||
<p>Window width: <span id="width"></span></p>
|
||||
|
||||
<script type="text/javascript">
|
||||
var heightOutput = document.querySelector('#height');
|
||||
var widthOutput = document.querySelector('#width');
|
||||
|
||||
function resize() {
|
||||
heightOutput.textContent = window.innerHeight;
|
||||
widthOutput.textContent = window.innerWidth;
|
||||
}
|
||||
|
||||
window.onresize = resize;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue