| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 body, html { |
| 6 height: 100%; |
| 7 margin: 0px; |
| 8 } |
| 9 |
| 10 body:-webkit-full-screen-ancestor > :not(:-webkit-full-screen-ancestor):no
t(:-webkit-full-screen) { |
| 11 display: none!important |
| 12 } |
| 13 |
| 14 #spacer { |
| 15 width: 200px; |
| 16 height: 3000px; |
| 17 background-color: red; |
| 18 } |
| 19 |
| 20 #fullscreenElement { |
| 21 width: 20px; |
| 22 height: 20px; |
| 23 background-color: blue; |
| 24 position: absolute; |
| 25 left: 10px; |
| 26 top: 500px; |
| 27 } |
| 28 </style> |
| 29 <script> |
| 30 // To test manually, you can enter fullscreen by clicking on the blue squa
re while |
| 31 // the page has some scroll offset. Exiting fullscreen should reset to the
previous |
| 32 // scroll position. |
| 33 var fullscreen = false; |
| 34 addEventListener('load', function() { |
| 35 document.getElementById('fullscreenElement').addEventListener('click', f
unction() { |
| 36 if (fullscreen) |
| 37 document.webkitExitFullscreen(); |
| 38 else |
| 39 this.webkitRequestFullscreen(); |
| 40 |
| 41 fullscreen = !fullscreen; |
| 42 }); |
| 43 }); |
| 44 </script> |
| 45 </head> |
| 46 |
| 47 <body> |
| 48 <div id="spacer"></div> |
| 49 <div id="fullscreenElement"></div> |
| 50 </body> |
| 51 </html> |
| OLD | NEW |