diogogmt

mozFullScreen

Nov 17th, 2011
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4.  
  5. </head>
  6.  
  7. <body>
  8. <a href="#" id="requestFS">Request Full Screen</a>
  9. <br />
  10. <a href="#" id="cancelFS">Cancel Full Screen</a>
  11.  
  12.  
  13. <script>
  14.  
  15. document.getElementById("requestFS").addEventListener("click", function () {
  16. console.log("Request Full Screen");
  17. document.body.mozRequestFullScreen();
  18. }, false);
  19.  
  20. document.getElementById("cancelFS").addEventListener("click", function () {
  21. console.log("Cancel Full Screen");
  22. document.mozCancelFullScreen();
  23. }, false);
  24.  
  25. document.addEventListener("mozfullscreenchange", function (e) {
  26. console.log("Screen changed");
  27. }, false)
  28.  
  29. document.body.mozRequestFullScreen();
  30. </script>
  31.  
  32. </body>
  33.  
  34. </html>
  35.  
Advertisement
Add Comment
Please, Sign In to add comment