Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
151 - 1
<!DOCTYPE html>
2
<html>
3
<head>
4
<title>Inner Window Size</title>
5
</head>
6
<body>
7
<h1>Inner Window Size</h1>
8
<p>Width: <span id="width"></span></p>
9
<p>Height: <span id="height"></span></p>
10
<script>
11
document.addEventListener("DOMContentLoaded", function() {
12
    document.getElementById("width").innerHTML = window.innerWidth;
13
    document.getElementById("height").innerHTML = window.innerHeight;
14
    window.addEventListener("resize", function (event) {
15
        document.getElementById("width").innerHTML = window.innerWidth;
16
        document.getElementById("height").innerHTML = window.innerHeight;
17
    });
18
});
19
</script>
20
</body>
21
</html>