rotation2.html 419 B

123456789101112131415
  1. <html>
  2. <script>
  3. async function toggleFullscreen() {
  4. if (!document.fullscreenElement) {
  5. await document.documentElement.requestFullscreen();
  6. await screen.orientation.lock("landscape-primary");
  7. } else {
  8. document.exitFullscreen();
  9. }
  10. }
  11. </script>
  12. <body style="height:5000px" onclick="toggleFullscreen();">
  13. <p>A page that will rotate on touch.</p>
  14. </body>
  15. </html>