Skip to content

Commit

Permalink
style/timing
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Jul 26, 2012
1 parent b6965bd commit 5c3af3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions visibilitytest.html
Expand Up @@ -3,6 +3,7 @@
<title>Visibility test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
var now = Date.now();
// Browser compatibility:
var hidden, visibilityChange;
if (typeof document.hidden !== "undefined") {
Expand All @@ -28,14 +29,14 @@
var state = document[visibilityState];
var text = $('#output').text();
text += '\n';
text += visibilityChange + ' hidden: ' + isHidden + ' state: ' + state + ' at ' + (new Date());
text += visibilityChange + ' hidden: ' + isHidden + ' state: ' + state + ' at ' + (Date.now() - now);
$('#output').text(text);
}, false);
</script>
</head>
<body>

<pre id="output">Output:</pre>
<pre style="border: 1px solid #000" id="output">Output:</pre>

<div>To test state changes, switch to or from this page; each even will be displayed in the box above.</div>

Expand Down

0 comments on commit 5c3af3a

Please sign in to comment.