screen-availLeft.html 825 B

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script type="text/javascript">
  5. function log(s)
  6. {
  7. var output = document.getElementById('output');
  8. output.innerHTML += s + "<br>";
  9. }
  10. function doTest()
  11. {
  12. window.setInterval(function() {
  13. var screen = window.screen;
  14. log('screen availLeft: ' + screen.availLeft + ' availTop: ' + screen.availTop);
  15. }, 1000);
  16. }
  17. window.addEventListener('load', doTest, false);
  18. </script>
  19. </head>
  20. <body>
  21. <p>On a two-monitor system, configure the menu bar to be on the right screen. Then drag this window between screens. When on the left screen, screen.availLeft should be negative.</p>
  22. <div id="output"></div>
  23. </body>
  24. </html>